我试图从源代码构建JHipster注册表,并为此跟踪马特·雷布尔的教程。
但是,退出代码1出现了一个错误,下面是生成的堆栈跟踪。
yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents@1.1.1: The platform "win32" is incompatible with this module.
info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "angular2-cookie@1.2.6" has incorrect peer dependency "@angular/common@^2.0.0".
warning "angular2-cookie@1.2.6" has incorrect peer dependency "@angular/core@^2.0.0".
warning "ng2-translate@4.2.0" has incorrect peer dependency "@angular/core@^2.0.0".
warning "ng2-translate@4.2.0" has incorrect peer dependency "@angular/http@^2.0.0".
[4/4] Building fresh packages...
[1/4] ⢀ node-sass: could not find "C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE". checking
[-/4] ⢀ waiting...
[3/4] ⠠ phantomjs-prebuilt: Receiving...
[-/4] ⠠ waiting...
error D:\JHipster\jhipster-microservices-example\registry\node_modules\node-
sass: Command failed.
Exit code: 1
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c node scripts/build.js
Directory: D:\JHipster\jhipster-microservices-example\registry\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe D:\JHipster\jhipster-microservices-example\registry\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'D:\\JHipster\\jhipster-microservices-example\\registry\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.0
gyp info using node@8.3.0 | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21)
gyp verb `which` failed python2 { Error: not found: python2
gyp verb `which` failed at getNotFoundError (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:80:29)
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\which\which.js:89:16
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\isexe\index.js:42:5
gyp verb `which` failed at D:\JHipster\jhipster-microservices-example\registry\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqWrap.oncomplete (fs.js:152:21) code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE
gyp verb check python version `C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE -c "import platform; print(platform.python_version());"` returned: "3.5.4\r\n"
gyp verb could not find "C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE". checking python launcher
gyp verb could not find "C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\Srikar\AppData\Local\Programs\Python\Python35\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (D:\JHipster\jhipster-microservices-example\registry\node_modules\node-gyp\lib\configure.js:482:19)
gyp ERR! stack at PythonFinder.<anonymous> (D:\JHipster\jhipster-microservices-example\registry\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at D:\JHipster\jhipster-microservices-example\registry\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.16251
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\JHipster\\jhipster-microservices-example\\registry\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd D:\JHipster\jhipster-microservices-example\registry\node_modules\node-sass
gyp ERR! node -v v8.3.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
Build failed with error code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
执行的步骤:
1)将JHipster注册表作为压缩从Github下载并解压缩。
2)导航到Windows PowerShell中的该目录,并运行yarn
或yarn install
。
我是JHipster的新手。我不确定问题是与sass或python2或其他问题有关。我在寻找关于这个问题的详细信息,以及如何解决它?
节点版本: 8.3.0
动力外壳版本: 5.1.16251.0
OS ->
版本: Windows 10企业内部人士预览
版本: 1703
操作系统构建: 16251.1002
[据我所知,
( i)使用fsevents发出警告是因为我使用的是Windowsx-64,而fsevents主要用于Mac监控文件系统。对吗?
( ii)注册表是否在前端设计中使用角2?(尽管您可以使用JHispter构建Range4应用程序)
当构建新的包时,node_sass抱怨它找不到python.exe文件,但是我检查了文件夹,但是文件是存在的。我的路上也有蟒蛇3.5.4。
在接下来的步骤中,它是因为没有找到python2而寻找python3吗?如果JHipster是一个SpirngBoot(后端)+角(前端)应用程序,那么在哪里使用python?我们也能写一些温和的python脚本吗?]
发布于 2017-08-29 11:14:30
(1)更正您可以忽略此警告
( ii)注册表是JHipster生成的应用程序(您可以在.yo-rc.json
文件中看到它的选项),它的UI使用角4
python只用于构建节点,而不是应用运行时,这里的问题是无法构建的节点sass,这是一个环境问题:
现在,坏消息是您在Windows上;nodejs最好的平台是Linux和macOS,Matt在macOS上,所以他没有遇到所有的问题。即使修复了python和nodejs版本,native也可能无法构建本机模块。如果发生这种情况,您几乎没有其他选择:
发布于 2018-01-31 00:47:39
我刚把NodeJS降级到6.x,事情就开始好转了。因此,请试着降低它的等级,并重新编译使用:纱线。
https://stackoverflow.com/questions/45935738
复制相似问题