答案 0 :(得分:0)
这是因为npm install
被设置为gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\github\ngx-admin\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\github\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\github\ngx-admin\node_modules\wintersmith-sassy\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with error code: 1
npm WARN ngx-toastr@4.4.1 requires a peer of @angular/core@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-toastr@4.4.1 requires a peer of @angular/common@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\watchpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@3.13.1 postinstall 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! C:\Users\danyb\AppData\Roaming\npm-cache\_logs\2019-01-29T18_25_12_699Z-debug.log
。 Heroku通常以mongoose
模式部署事物,这意味着未安装开发依赖项。您应该在devDependency
中将production
设置为常规mongoose
。
(您还可以告诉Heroku在dependency
模式下运行,但这可能不是正确的解决方案,因为您几乎肯定希望在生产中使用猫鼬。)
答案 1 :(得分:0)
这是因为猫鼬列在package.json的devDependencies
中。
默认情况下,Heroku将在部署应用程序之前剥离在devDependencies
下声明的模块。
解决此问题的一种方法是将猫鼬移至package.json上的dependencies
。另一种方法是将NODE_ENV环境变量设置为默认值production
以外的其他值,因此Heroku将保留devDependencies
上的模块。