在一个项目上运行'npm'安装得到node-gyp错误。

时间:2015-12-31 14:26:48

标签: node.js npm

我尝试了什么:

  • 最初有关于已弃用软件包的警告,因此更新了

  • npm config set msvs_version = 2015 --global(这似乎导致了一些人的问题)

道歉,如果这有点基础,我是新的,但我已经尽力解决这个问题无济于事,我真的需要这作为我新工作培训的一部分,所以任何帮助都非常感谢。

我正在尝试加载此git存储库中找到的项目:https://github.com/taylonr/intro-to-protractor

安装量角器的第一部分顺利完成但是当我尝试加载项目的依赖项时,我遇到了问题。

其他信息:

  • Windows 10
  • Node.js 4.2.3
  • Python v2.7.1
  • Visual Studio Community 2015
  • npm 3.5.2(当我做npm -v时)
  • node-gyp 3.2.1

crhistian@crhistian-HP /cygdrive/c/users/crhistian/webstormprojects/intro-to-pro                                             tractor
$ npm install

> v8-debug@0.4.6 preinstall C:\users\crhistian\webstormprojects\intro-to-protrac                                             tor\node_modules\.staging\v8-debug-641e94fa
>

npm WARN prefer global node-inspector@0.9.2 should be installed with -g

> v8-debug@0.4.6 install C:\users\crhistian\webstormprojects\intro-to-protractor                                             \node_modules\v8-debug
> node-pre-gyp install --fallback-to-build


C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if                                              not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n                                             ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" c                                             lean )  else (node  clean )

C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if                                              not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n                                             ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" c                                             onfigure --fallback-to-build --module=C:\users\crhistian\webstormprojects\intro-                                             to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug.                                             node --module_name=debug --module_path=C:\users\crhistian\webstormprojects\intro                                             -to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 --pyt                                             hon=python --msvs_version=2015 )  else (node  configure --fallback-to-build --mo                                             dule=C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-deb                                             ug\build\debug\v0.4.6\node-v46-win32-x64\debug.node --module_name=debug --module                                             _path=C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-de                                             bug\build\debug\v0.4.6\node-v46-win32-x64 --python=python --msvs_version=2015 )

C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug>if                                              not defined npm_config_node_gyp (node "C:\Users\crhistian\AppData\Roaming\npm\n                                             ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" b                                             uild --fallback-to-build --module=C:\users\crhistian\webstormprojects\intro-to-p                                             rotractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug.node                                              --module_name=debug --module_path=C:\users\crhistian\webstormprojects\intro-to-                                             protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 )  else (                                             node  build --fallback-to-build --module=C:\users\crhistian\webstormprojects\int                                             ro-to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\deb                                             ug.node --module_name=debug --module_path=C:\users\crhistian\webstormprojects\in                                             tro-to-protractor\node_modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64 )
Building the projects in this solution one at a time. To enable parallel build,                                              please add the "/m" switch.
  debug.cc
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(2                                             63): error C2995: 'v8::Local<T> _NanEnsureLocal(v8::Local<T>)': function templat                                             e has already been defined [C:\users\crhistian\webstormprojects\intro-to-protrac                                             tor\node_modules\v8-debug\build\debug.vcxproj]
  C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h                                             (256): note: see declaration of '_NanEnsureLocal'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             61): error C3083: 'smalloc': the symbol to the left of a '::' must be a type [C:                                             \users\crhistian\webstormprojects\intro-to-protractor\node_modules\v8-debug\buil                                             d\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             61): error C2039: 'FreeCallback': is not a member of 'node' [C:\users\crhistian\                                             webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_object_wrap.h(8): note: s                                             ee declaration of 'node'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             61): error C2061: syntax error: identifier 'FreeCallback' [C:\users\crhistian\we                                             bstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             65): error C2065: 'callback': undeclared identifier [C:\users\crhistian\webstorm                                             projects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             65): error C2065: 'hint': undeclared identifier [C:\users\crhistian\webstormproj                                             ects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             72): error C2665: 'node::Buffer::New': none of the 4 overloads could convert all                                              the argument types [C:\users\crhistian\webstormprojects\intro-to-protractor\nod                                             e_modules\v8-debug\build\debug.vcxproj]
  C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(43): note: could                                              be 'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,char *,size_t)'
  C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(31): note: or                                                    'v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate *,v8::Local<v8::St                                             ring>,node::encoding)'
  C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h                                             (672): note: while trying to match the argument list '(v8::Isolate *, const char                                              *, uint32_t)'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             76): error C2440: 'return': cannot convert from 'v8::MaybeLocal<v8::Object>' to                                              'v8::Local<v8::Object>' [C:\users\crhistian\webstormprojects\intro-to-protractor                                             \node_modules\v8-debug\build\debug.vcxproj]
  C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h                                             (676): note: No constructor could take the source type, or constructor overload                                              resolution was ambiguous
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             83): error C2039: 'Use': is not a member of 'node::Buffer' [C:\users\crhistian\w                                             ebstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
  C:\Users\crhistian\.node-gyp\4.2.3\include\node\node_buffer.h(8): note: see de                                             claration of 'node::Buffer'
C:\users\crhistian\webstormprojects\intro-to-protractor\node_modules\nan\nan.h(6                                             83): error C3861: 'Use': identifier not found [C:\users\crhistian\webstormprojec                                             ts\intro-to-protractor\node_modules\v8-debug\build\debug.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` fail                                             ed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\crhistian\AppData\Roaming\np                                             m\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_proces                                             s.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhistian\\Ap                                             pData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js                                             " "build" "--fallback-to-build" "--module=C:\\users\\crhistian\\webstormprojects                                             \\intro-to-protractor\\node_modules\\v8-debug\\build\\debug\\v0.4.6\\node-v46-wi                                             n32-x64\\debug.node" "--module_name=debug" "--module_path=C:\\users\\crhistian\\                                             webstormprojects\\intro-to-protractor\\node_modules\\v8-debug\\build\\debug\\v0.                                             4.6\\node-v46-win32-x64"
gyp ERR! cwd C:\users\crhistian\webstormprojects\intro-to-protractor\node_module                                             s\v8-debug
gyp ERR! node -v v4.2.3
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp.cmd build --fallback-                                             to-build --module=C:\users\crhistian\webstormprojects\intro-to-protractor\node_m                                             odules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64\debug.node --module_name=d                                             ebug --module_path=C:\users\crhistian\webstormprojects\intro-to-protractor\node_                                             modules\v8-debug\build\debug\v0.4.6\node-v46-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\crhistian\Webs                                             tormProjects\intro-to-protractor\node_modules\node-pre-gyp\lib\util\compile.js:8                                             3:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:818:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/chi                                             ld_process.js:211:5)
node-pre-gyp ERR! System Windows_NT 10.0.10586
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhi                                             stian\\WebstormProjects\\intro-to-protractor\\node_modules\\node-pre-gyp\\bin\\n                                             ode-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\users\crhistian\webstormprojects\intro-to-protractor\no                                             de_modules\v8-debug
node-pre-gyp ERR! node -v v4.2.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\users\crhi                                             stian\webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug\v0.                                             4.6\node-v46-win32-x64\debug.node --module_name=debug --module_path=C:\users\crh                                             istian\webstormprojects\intro-to-protractor\node_modules\v8-debug\build\debug\v0                                             .4.6\node-v46-win32-x64' (1)
copperpitch@0.0.1 C:\users\crhistian\webstormprojects\intro-to-protractor
├─┬ bower@1.3.12
│ ├─┬ bower-registry-client@0.2.4
│ │ └─┬ request@2.51.0
│ │   └─┬ form-data@0.2.0
│ │     └── async@0.9.2
│ ├─┬ insight@0.4.3
│ │ └── async@0.9.2
│ └─┬ request@2.42.0
│   └─┬ form-data@0.1.4
│     └── async@0.9.2
├── UNMET PEER DEPENDENCY grunt@~0.4.0
├─┬ karma@0.12.37
│ ├─┬ chokidar@1.4.2
│ │ └─┬ readdirp@2.0.0
│ │   └── minimatch@2.0.10
│ ├─┬ connect@2.30.2
│ │ ├─┬ compression@1.5.2
│ │ │ ├─┬ accepts@1.2.13
│ │ │ │ └── negotiator@0.5.3
│ │ │ └─┬ compressible@2.0.6
│ │ │   └── mime-db@1.20.0
│ │ ├─┬ connect-timeout@1.6.2
│ │ │ ├── debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ ├── cookie@0.1.3
│ │ ├── cookie-signature@1.0.6
│ │ ├─┬ csurf@1.8.3
│ │ │ ├── cookie@0.1.3
│ │ │ └── cookie-signature@1.0.6
│ │ ├─┬ debug@2.2.0
│ │ │ └── ms@0.7.1
│ │ ├─┬ errorhandler@1.4.2
│ │ │ ├─┬ accepts@1.2.13
│ │ │ │ ├─┬ mime-types@2.1.8
│ │ │ │ │ └── mime-db@1.20.0
│ │ │ │ └── negotiator@0.5.3
│ │ │ └── escape-html@1.0.2
│ │ ├─┬ finalhandler@0.4.0
│ │ │ ├─┬ debug@2.2.0
│ │ │ │ └── ms@0.7.1
│ │ │ └── escape-html@1.0.2
│ │ ├── fresh@0.3.0
│ │ ├─┬ method-override@2.3.5
│ │ │ └── methods@1.1.1
│ │ ├── parseurl@1.3.0
│ │ ├── qs@4.0.0
│ │ ├─┬ serve-favicon@2.3.0
│ │ │ ├── fresh@0.3.0
│ │ │ ├── ms@0.7.1
│ │ │ └── parseurl@1.3.0
│ │ ├─┬ serve-index@1.7.2
│ │ │ ├─┬ accepts@1.2.13
│ │ │ │ └── negotiator@0.5.3
│ │ │ ├─┬ debug@2.2.0
│ │ │ │ └── ms@0.7.1
│ │ │ ├── escape-html@1.0.2
│ │ │ ├─┬ mime-types@2.1.8
│ │ │ │ └── mime-db@1.20.0
│ │ │ └── parseurl@1.3.0
│ │ ├─┬ serve-static@1.10.0
│ │ │ ├── escape-html@1.0.2
│ │ │ └─┬ send@0.13.0
│ │ │   ├── mime@1.3.4
│ │ │   └── range-parser@1.0.3
│ │ └─┬ type-is@1.6.10
│ │   └── mime-types@2.1.8
│ ├── mime@1.3.4
│ └── minimatch@2.0.10
├─┬ karma-coverage@0.2.7
│ └─┬ istanbul@0.3.22
│   └─┬ fileset@0.2.1
│     └── minimatch@2.0.10
└─┬ mongoose@3.8.37
  └─┬ mquery@1.6.1
    └─┬ debug@2.2.0
      └── ms@0.7.1

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fseve                                             nts@1.0.6
npm WARN grunt-concurrent@0.5.0 requires a peer of grunt@~0.4.0 but none was ins                                             talled.
npm WARN grunt-contrib-csslint@0.2.0 requires a peer of grunt@~0.4.0 but none wa                                             s installed.
npm WARN grunt-contrib-cssmin@0.9.0 requires a peer of grunt@~0.4.1 but none was                                              installed.
npm WARN grunt-contrib-jshint@0.10.0 requires a peer of grunt@~0.4.0 but none wa                                             s installed.
npm WARN grunt-contrib-uglify@0.4.1 requires a peer of grunt@~0.4.0 but none was                                              installed.
npm WARN grunt-contrib-watch@0.6.1 requires a peer of grunt@~0.4.0 but none was                                              installed.
npm WARN grunt-karma@0.8.3 requires a peer of grunt@0.4.x but none was installed                                             .
npm WARN grunt-nodemon@0.2.1 requires a peer of grunt@~0.4.1 but none was instal                                             led.
npm WARN grunt-node-inspector@0.1.6 requires a peer of grunt@~0.4.2 but none was                                              installed.
npm WARN copperpitch@0.0.1 No repository field.
npm WARN copperpitch@0.0.1 No license field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\crhistian\\AppDa                                             ta\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug@0.4.6 install script 'node-pre-gyp install --fal                                             lback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs v8-debug
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls v8-debug
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\users\crhistian\webstormprojects\intro-to-protractor\npm-debug.l                                             og

2 个答案:

答案 0 :(得分:0)

根据文档,您需要安装以下先决条件:

的Node.js, MongoDB的, 鲍尔 咕噜

答案 1 :(得分:0)

最新文档指出2015年不起作用,您必须使用2013来解决gyp问题。请参阅有关这一切是如何形成的讨论: https://discuss.atom.io/t/build-on-windows-could-not-locate-visual-studio-error/19888

我正在将我的VM切换到2013年,如果我成功了,我会告诉您。