wac*_*cko 2 node.js npm gitlab gulp gitlab-ci
NPM安装正确,但我在部署时不断收到此错误.
npm info ok
$ gulp
/bin/bash: line 48: gulp: command not found
ERROR: Job failed: exit code 1
Run Code Online (Sandbox Code Playgroud)
我的.gitlab-ci.yml看起来像这样
image: node:latest
cache:
paths:
- node_modules/
before_script:
- npm install
pages:
stage: deploy
script:
- gulp
artifacts:
paths:
- public
Run Code Online (Sandbox Code Playgroud)
我的package.json包括以下内容
"scripts": {
"install": "gulp",
"test": "gulp test"
},
"devDependencies": {
"gulp": "^3.9.1"
}
Run Code Online (Sandbox Code Playgroud)
而且我知道我的gulpfile.js很好,因为它在本地运行很好,运行我需要的任何一个npm install
或简单gulp
.真的不确定我做错了什么.
通过在本地运行npm install
您安装软件包,它将保存到项目的文件夹中,并且不会全局可用或作为别名(除非它已全局安装).因此,如果您想使用别名,您应该全局安装它:或者您可以使用命令从本地文件夹运行gulp .node_modules
gulp
npm install -g gulp
node_modules
./node_modules/.bin/gulp
归档时间: |
|
查看次数: |
2315 次 |
最近记录: |