gpt4 book ai didi

npm - 找不到gulp命令

转载 作者:行者123 更新时间:2023-12-04 13:49:20 26 4
gpt4 key购买 nike

Windows 10专业版x64

我运行了以下命令

npm install --global gulp-cli
npm init

然后我将目录更改为我的项目:
npm install --save-dev gulp

然后试着大口吃
-bash: gulp: command not found

我的package.json文件读取
{
"name": "riad-kilani_v4-child",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"dependencies": {
"gulp-cli": "^1.2.2"
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-sass": "^2.3.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}

对这里发生的事情有什么想法吗?

最佳答案

我解决了在〜/.bashrc中创建别名的问题,如下所示:

alias gulp="node /home/deploy/app/node_modules/gulp/bin/gulp.js"

只需将别名放在.bashrc文件的末尾,然后运行:
source ~/.bashrc

测试:
gulp -v

您应该会看到类似以下内容的内容:
[15:46:39] CLI version 3.9.1
[15:46:39] Local version 3.9.1

关于npm - 找不到gulp命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40390887/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com