npm ERR!无法读取未定义的属性“ pause”-Bluemix [英] npm ERR! Cannot read property 'pause' of undefined --Bluemix
问题描述
我试图将Sails.js应用程序部署到Bluemix,并且在Bluemix上的工具链中的部署阶段(调用CF PUSH命令时)遇到以下错误:
I am trying to deploy a Sails.js app to Bluemix and we are getting the following error during the deploy stage in the toolchain on Bluemix (When the CF PUSH command is called):
npm错误!无法读取未定义的属性 pause
npm ERR! Cannot read property 'pause' of undefined
我了解跟踪信息会转到npm-error.log文件,但是由于无法访问我们无法通过ssh来查看文件中的内容,因为在错误的部署之后应用程序处于关闭状态。
I understand the trace goes to the npm-error.log file, however, I haven't been able to get to it as we cannot ssh in to see whats in the file as the application is in its "off" state after a bad deploy.
通过两次Cf推送成功部署了相同的代码{app name}},并在8天前通过Bluemix中的简单构建和部署工具链。
This same code was successfully deployed with both Cf push {app name}} and through a simple build and deploy toolchain in Bluemix just 8 days ago.
在构建阶段,我可以运行Npm install和npm update。但是,似乎无论如何它都会在部署阶段再次执行此操作,并且失败。这是有关此故障的一些详细信息
In the build stage I can run Npm install and npm update just fine. However, it seems to do this again in the deploy stage regardless and it fails. Here is some detail on this failure
NODE_ENV=production
NPM_CONFIG_LOGLEVEL=error
NPM_CONFIG_PRODUCTION=true
Visit http://docs.cloudfoundry.org/buildpacks/node/index.html#vendoring
NODE_HOME=/tmp/app/.cloudfoundry/0/node
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
Restoring cache
Loading 3 from cacheDirectories (default):
- .npm
- .cache/yarn (not cached - skipping)
- bower_components (not cached - skipping)
Installing node modules (package.json) Building dependencies
sails@0.12.13 preinstall /tmp/app/node_modules/sails
node ./lib/preinstall_npmcheck.js
Sails.js Installation: Checking npm-version successful
npm ERR! Cannot read property 'pause' of undefined
npm ERR! /tmp/app/.npm/_logs/2017-09-09T17_02_48_660Z-debug.log
**ERROR** Unable to build dependencies: exit status 1
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
npm ERR! A complete log of this run can be found in:
Successfully destroyed container
Package.json文件
Package.json file
{
"name": "myApp",
"private": true,
"version": "0.0.1",
"description": "Stuff my app does",
"keywords": [
"Cool Apps"
],
"dependencies": {
"bcryptjs": "^2.4.3",
"cacheman": "^2.2.1",
"ejs": "2.3.4",
"elasticsearch": "^13.0.0-rc2",
"find-remove": "^1.0.1",
"fs": "0.0.1-security",
"grunt": "1.0.1",
"grunt-contrib-clean": "1.0.0",
"grunt-contrib-coffee": "1.0.0",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-cssmin": "1.0.1",
"grunt-contrib-jst": "1.0.0",
"grunt-contrib-less": "1.3.0",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
"grunt-sails-linker": "~0.10.1",
"grunt-sync": "0.5.2",
"include-all": "^1.0.0",
"jsonwebtoken": "^7.3.0",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"passport": "^0.2.x",
"passport-http-bearer": "^1.0.1",
"passport-idaas-openidconnect": "^1.1.0",
"passport-local": "^1.0.0",
"rc": "1.0.1",
"request": "^2.81.0",
"request-promise": "^4.2.0",
"sails": "~0.12.13",
"sails-disk": "~0.10.9",
"sails-mongo": "^0.12.2",
"stream": "0.0.2",
"uuid-1345": "^0.99.6",
"validator": "^7.0.0",
"natural-sort": "^1.0.0"
},
"scripts": {
"start": "node app.js"
},
"engines": {
"node": "^8.0.x",
"npm": "^5.0.x"
},
"main": "app.js",
"author": "Scott N",
"license": ""
}
到目前为止,我已经尝试过。
-更改节点版本
-更改npm版本
-更改依赖项版本以包括^前缀
-删除package.json文件中除Sails之外的所有依赖项
Things I've tried so far. -change node versions -changed npm versions -change dependencies versions to include the ^ prefix -removed all dependencies but Sails in the package.json file
所以Sails.js和Nodebuildpack / Bluemix的配合不好。
So Sails.js and the Nodebuildpack/Bluemix aren't playing well with each other.
任何帮助将不胜感激。
谢谢
Any help would be appreciated. Thank you
推荐答案
在我身上也是如此。而且我必须回退npm的先前版本:5.3.0,现在可以使用了。 (BTW:macOS)
It happens to me just the same. and I've to roll back the prev version of npm: 5.3.0 and it's working now. (BTW: macOS)
仅当我更新我的npm版本时才会发生错误:
The error only happens when I update my npm version like this:
Update available 5.3.0 → 5.4.1
Run npm i -g npm to update
这篇关于npm ERR!无法读取未定义的属性“ pause”-Bluemix的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!