晦涩难懂的构建脚本开始失败。环境或配置根本没有变化。在dev中工作正常,在产品中失败。早午餐构建 - 生产仅在生产中失败
两个开发和生产线(包括Ubuntus):
$ npm -v
5.3.0
$ node -v
v6.11.2
在开发:
[email protected] ~/Code/loaded.bike/assets $ npm run deploy
> @ deploy /home/oleg/Code/loaded.bike/assets
> brunch build --production
17:49:59 - info: compiling
17:49:59 - info: compiled 19 files into 2 files, copied 32 in 6.9 sec
在PROD:
[email protected]:~/builds/assets$ npm run deploy
> @ deploy /home/deploy/builds/assets
> brunch build --production
00:45:30 - error: Initialization error - Could not load global module 'jquery'. Possible solution: add 'jquery' to package.json and `npm install`. Could not load global module 'jquery'. Possible solution: add 'jquery' to package.json and `npm install`.
Stack trace was suppressed. Run with `LOGGY_STACKS=1` to see the trace.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ deploy: `brunch build --production`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/deploy/.npm/_logs/2017-08-12T00_45_30_084Z-debug.log
完整的日志:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'deploy' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
5 info lifecycle @~predeploy: @
6 info lifecycle @~deploy: @
7 verbose lifecycle @~deploy: unsafe-perm in lifecycle true
8 verbose lifecycle @~deploy: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/deploy/builds/assets/node_modules/.bin:/home/deploy/bin:/home/deploy/.local
/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle @~deploy: CWD: /home/deploy/builds/assets
10 silly lifecycle @~deploy: Args: [ '-c', 'brunch build --production' ]
11 silly lifecycle @~deploy: Returned: code: 1 signal: null
12 info lifecycle @~deploy: Failed to exec deploy script
13 verbose stack Error: @ deploy: `brunch build --production`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:289:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:891:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid @
15 verbose cwd /home/deploy/builds/assets
16 verbose Linux 4.8.0-41-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
18 verbose node v6.11.2
19 verbose npm v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error @ deploy: `brunch build --production`
22 error Exit status 1
23 error Failed at the @ deploy script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
添加jquery
,tether
到package.json
修复程序require
错误,但它然后只是在sass编译扼流圈。这只是JS失误异步函数不按顺序或这是什么?再次,它开始彻底失败。昨天和今天部署得很好,如果失败,我不会改变任何事情。任何线索可能是错误的?
编辑:
的package.json:
{
"repository": {},
"license": "MIT",
"scripts": {
"deploy": "brunch build --production",
"watch": "brunch watch --stdin"
},
"dependencies": {
"bootstrap": "^4.0.0-alpha.6",
"phoenix": "file:../deps/phoenix",
"phoenix_html": "file:../deps/phoenix_html"
},
"devDependencies": {
"babel-brunch": "6.0.6",
"brunch": "2.10.10",
"clean-css-brunch": "2.10.0",
"css-brunch": "2.10.0",
"sass-brunch": "2.10.4",
"uglify-js-brunch": "2.1.1"
}
}
实际上,我看到在PROD此废话(但不是DEV)
npm ERR! peer dep missing: [email protected]>=3.0.0, required by [email protected]
npm ERR! peer dep missing: [email protected]^1.11.0, required by [email protected]
那是什么呢? Bootstrap将它们定义为它自己的package.json中的依赖关系(而不是peerDependency)。 npm现在不依赖于依赖关系吗?
尝试降级[email protected] –
@ mehta-rohan nope,同样的错误 – Grocery
share package.json –