2 weiliux weiliux 于 2016.01.13 11:13 提问

nodejs创建kraken项目报错,使用vs2013

创建一个KRAKEN项目,npm install -g generator-kraken,报错提示node版本过低,手动升级版本0.10.28至4.2.4,继续创建,报错:

在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(399,5): error MSB3191: 无法创建目录“Release\obj\thread_sleep\thread_sleep.tlog\”。指定的路径或文件名太长,或者两者都太长。完全限定文件名必须少于 260 个字符,并且目录名必须少于 248 个字符。 [C:\Users\liuxiang\AppData\Roaming\npm\node_modules\generator-kraken\node_modules\yeoman-generator\node_modules\cross-spawn\node_modules\spawn-sync\node_modules\try-thread-sleep\node_modules\thread-sleep\build\thread_sleep.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe fail
ed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Document\node.js\node_modules\npm\node_modules\node-gyp\lib\build.js:270: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 6.1.7601
gyp ERR! command "C:\Document\node.js\node.exe" "C:\Document\node.js\node_
modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-b
uild" "--module=C:\Users\liuxiang\AppData\Roaming\npm\node_modules\genera
tor-kraken\node_modules\yeoman-generator\node_modules\cross-spawn\node_modu
les\spawn-sync\node_modules\try-thread-sleep\node_modules\thread-sleep\lib
\binding\Release\node-v46-win32-x64\thread_sleep.node" "--module_name=thread
sleep" "--module_path=C:\Users\liuxiang\AppData\Roaming\npm\node_modules\
\generator-kraken\node_modules\yeoman-generator\node_modules\cross-spawn\no
de_modules\spawn-sync\node_modules\try-thread-sleep\node_modules\thread-sle
ep\lib\binding\Release\node-v46-win32-x64"
gyp ERR! cwd C:\Users\liuxiang\AppData\Roaming\npm\node_modules\generator-kraken
\node_modules\yeoman-generator\node_modules\cross-spawn\node_modules\spawn-sync\
node_modules\try-thread-sleep\node_modules\thread-sleep
gyp ERR! node -v v4.2.4
gyp ERR! node-gyp -v v3.0.3
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\liuxiang\AppData\Roaming\npm\node_modules\generator-k
raken\node_modules\yeoman-generator\node_modules\cross-spawn\node_modules\spawn-
sync\node_modules\try-thread-sleep\node_modules\thread-sleep\lib\binding\Release
\node-v46-win32-x64\thread_sleep.node --module_name=thread_sleep --module_path=C
:\Users\liuxiang\AppData\Roaming\npm\node_modules\generator-kraken\node_modules\
yeoman-generator\node_modules\cross-spawn\node_modules\spawn-sync\node_modules\t
ry-thread-sleep\node_modules\thread-sleep\lib\binding\Release\node-v46-win32-x64
' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\Users\liuxiang\AppDa
ta\Roaming\npm\node_modules\generator-kraken\node_modules\yeoman-generator\node

modules\cross-spawn\node_modules\spawn-sync\node_modules\try-thread-sleep\node_m
odules\thread-sleep\node_modules\node-pre-gyp\lib\util\compile.js:83: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 6.1.7601
node-pre-gyp ERR! command "C:\Document\node.js\node.exe" "C:\Users\liuxiang
\AppData\Roaming\npm\node_modules\generator-kraken\node_modules\yeoman-ge
nerator\node_modules\cross-spawn\node_modules\spawn-sync\node_modules\try-
thread-sleep\node_modules\thread-sleep\node_modules\node-pre-gyp\bin\node-
pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\liuxiang\AppData\Roaming\npm\node_modules\generat
or-kraken\node_modules\yeoman-generator\node_modules\cross-spawn\node_modules\sp
awn-sync\node_modules\try-thread-sleep\node_modules\thread-sleep
node-pre-gyp ERR! node -v v4.2.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.9
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp.cmd build --fallback-to-build --module=C:\Users\liux
iang\AppData\Roaming\npm\node_modules\generator-kraken\node_modules\yeoman-gener
ator\node_modules\cross-spawn\node_modules\spawn-sync\node_modules\try-thread-sl
eep\node_modules\thread-sleep\lib\binding\Release\node-v46-win32-x64\thread_slee
p.node --module_name=thread_sleep --module_path=C:\Users\liuxiang\AppData\Roamin
g\npm\node_modules\generator-kraken\node_modules\yeoman-generator\node_modules\c
ross-spawn\node_modules\spawn-sync\node_modules\try-thread-sleep\node_modules\th
read-sleep\lib\binding\Release\node-v46-win32-x64' (1)
npm WARN optional dep failed, continuing thread-sleep@1.0.4

spawn-sync@1.0.15 postinstall C:\Users\liuxiang\AppData\Roaming\npm\node_modul
es\generator-kraken\node_modules\yeoman-generator\node_modules\cross-spawn\node_
modules\spawn-sync
node postinstall

generator-kraken@2.2.2 C:\Users\liuxiang\AppData\Roaming\npm\node_modules\genera
tor-kraken
├── debuglog@1.0.1
├── underscore.string@3.2.2
├── mkdirp@0.5.1 (minimist@0.0.8)
├── chalk@1.1.1 (escape-string-regexp@1.0.4, ansi-styles@2.1.0, supports-colo
r@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.0)
├── update-notifier@0.3.2 (is-npm@1.0.0, string-length@1.0.1, semver-diff@2.1
.0, latest-version@1.0.1, configstore@0.3.2)
└── yeoman-generator@0.20.3 (detect-conflict@1.0.0, read-chunk@1.0.1, yeoman-
assert@2.1.1, path-exists@1.0.0, yeoman-welcome@1.0.1, path-is-absolute@1.0.0, a
sync@1.5.2, mime@1.3.4, class-extend@0.1.2, text-table@0.2.0, diff@2.2.1, dargs@
4.1.0, xdg-basedir@2.0.0, user-home@2.0.0, istextorbinary@1.0.2, shelljs@0.5.3,
nopt@3.0.6, debug@2.2.0, run-async@0.1.0, cli-table@0.3.1, through2@2.0.0, glob@
5.0.15, findup-sync@0.2.1, rimraf@2.5.0, mem-fs-editor@2.1.0, sinon@1.17.2, gith
ub-username@2.1.0, dateformat@1.0.12, pretty-bytes@2.0.1, yeoman-environment@1.5
.2, gruntfile-editor@1.1.0, html-wiring@1.2.0, download@4.4.3, lodash@3.10.1, in
quirer@0.8.5, cross-spawn@2.1.4)

2个回答

91program
91program   Ds   Rxr 2016.01.13 12:08
已采纳

将 nodejs 工程放在根目录中试试,看错误的提示是目录层级太深了

weiliux
weiliux 已解决,虽然不是你提到的问题,还是感谢你的回答
接近 2 年之前 回复
CSDNXIAON
CSDNXIAON   2016.01.13 11:15

WIN7 + VS2013 使用c++创建项目各种报错问题解决方案
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!