[英]NPM not installing devDependencies on bitbucket pipeline?
I'm trying to setup my first Bitbucket pipeline which simply builds my application and deploys it to my FTP server using the following bitbucket-pipelines.yml
我正在尝试设置我的第一个 Bitbucket 管道,它只是构建我的应用程序并使用以下
bitbucket-pipelines.yml
将其部署到我的 FTP 服务器
image: node:6.9.4
pipelines:
default:
- step:
caches:
- node
script:
- npm install
- npm test
- step:
script:
- npm run build
- node deploy.js
The issue lies in the npm install
because when bitbucket tries to run the npm run build
command it says that rimraf
(a npm package) is not found.问题在于
npm install
,因为当 bitbucket 尝试运行npm run build
命令时,它说rimraf
(npm 软件包)。 rimraf
however is listed in my devDependencies
, all regular dependencies
in my package.json
are downloaded correctly.然而,
rimraf
列在我的devDependencies
中,我的package.json
中的所有常规dependencies
项都已正确下载。
There is no global variable set by my so the NODE_ENV
could not be it right?我没有设置全局变量所以
NODE_ENV
对不对?
I had the same issue with gulp.我对 gulp 有同样的问题。
Gulp was in devDependencies and also specified in package.json as script but still it said npm ERR! missing script: gulp
Gulp 在 devDependencies 中,也在 package.json 中指定为脚本,但它仍然说
npm ERR! missing script: gulp
npm ERR! missing script: gulp
The documentation says to install it globally, so there might be a related issue with your package.该文档说要全局安装它,因此您的软件包可能存在相关问题。
https://confluence.atlassian.com/bitbucket/javascript-node-js-with-bitbucket-pipelines-873891287.html https://confluence.atlassian.com/bitbucket/javascript-node-js-with-bitbucket-pipelines-873891287.html
I had this same issue.我有同样的问题。 For me, the problem was that the version of Node on my local development device was different from the version of Node in the
bitbucket-pipelines.yml
file .对我来说,问题是我本地开发设备上的 Node 版本与
bitbucket-pipelines.yml
文件中的 Node 版本不同。
To fix it, I went into bitbucket-pipelines.yml
and changed this line:为了修复它,我进入了
bitbucket-pipelines.yml
并更改了这一行:
image: node:10.15.3
to this:对此:
image: node:14.15.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.