react-book-examples icon indicating copy to clipboard operation
react-book-examples copied to clipboard

第八章的代码是npm install之后再运行吗?

Open JserJser opened this issue 5 years ago • 2 comments

我直接git clone 项目,然后cd 08/ 然后 npm install 安装依赖包 但是报错了:▒▒▒▒ʱ▒▒ 00:00:00.40 gyp ERR! build error gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\Administrator\desktop\forBook\react-book-examples\08\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Administrator\desktop\forBook\react-book-examples\08\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" gyp ERR! cwd C:\Users\Administrator\desktop\forBook\react-book-examples\08\node_modules\node-sass gyp ERR! node -v v10.15.3 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok Build failed with error code: 1 npm WARN [email protected] requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself. npm WARN react-book-examples@ No description npm WARN react-book-examples@ No license field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall: node scripts/build.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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\Administrator\AppData\Roaming\npm-cache_logs\2019-04-27T16_40_28_762Z-debug.log

JserJser avatar Apr 27 '19 16:04 JserJser

尝试删除 node_modules 再试一次

arcthur avatar May 01 '19 14:05 arcthur

作者大大,你可以试试哇,窝删除了再npm install还是报错哇~ 我是windows环境~ $ node -v v10.15.3 $ npm -v 6.9.0

JserJser avatar May 05 '19 01:05 JserJser