Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
657 views
in Technique[技术] by (71.8m points)

node.js - Error with npm install - a pre-gyp error

I wanted to install this angular 2 calendar using npm. Tried to use npm to install it and then downloaded it and tried to install it. In both cases its failed.

I am on windows and I previously got this error trying to install angular2 CLI. Now I am getting the same error for this package and I am not sure how to rectify it. I tried to unistall the CLI and then clear the cache and that didnt work.

Could some one have a look at the error and let me know what steps I need to do to rectify this..

The error as it appears on the cmd is as follows:

        C:UserssimonSPAANGULAR2 CALENDAR EXAMPLE>npm install

    > [email protected] install C:Userssimon
ode_modules
ode-zopfli
    > node-pre-gyp install --fallback-to-build

    node-pre-gyp ERR! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz
    node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Platformsx64PlatformToolsetsv140Toolset.targets(36,5): error
     MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK vers
    ion in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:Userssimon
    node_modules
ode-zopfliuildzopfli.vcxproj]
    gyp ERR! build error
    gyp ERR! stack Error: `C:Program Files (x86)MSBuild14.0inmsbuild.exe` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onExit (C:Userssimon
ode_modules
ode-gyplibuild.js:276:23)
    gyp ERR! stack     at emitTwo (events.js:106:13)
    gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
    gyp ERR! System Windows_NT 10.0.14393
    gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\simon\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Users\simon\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node" "--module_name=zopfli" "--module_path=C:\Users\simon\node_modules\node-zopfli\lib\binding\node-v48-win32-x64"
    gyp ERR! cwd C:Userssimon
ode_modules
ode-zopfli
    gyp ERR! node -v v6.6.0
    gyp ERR! node-gyp -v v3.4.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Files
odejs
ode.exe C:Userssimon
ode_modules
ode-gypin
ode-gyp.js build --fallback-to-build --module=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64zopfli.node --module_name=zopfli --module_path=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:Userssimon
ode_modules
ode-pre-gyplibutilcompile.js:83:29)
    node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
    node-pre-gyp ERR! System Windows_NT 10.0.14393
    node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\simon\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd C:Userssimon
ode_modules
ode-zopfli
    node-pre-gyp ERR! node -v v6.6.0
    node-pre-gyp ERR! node-pre-gyp -v v0.6.30
    node-pre-gyp ERR! not ok
    Failed to execute 'C:Program Files
odejs
ode.exe C:Userssimon
ode_modules
ode-gypin
ode-gyp.js build --fallback-to-build --module=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64zopfli.node --module_name=zopfli --module_path=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64' (1)

I am on node.js 6.6.0 and npm 3.10.3

EDIT:

I was hoping Luiz answer...

npm install -g node-gyp

would work but unfortunately, whist the install worked perfectly for gym.. I got these errors.. as follows...

    > [email protected] install C:Userssimon
ode_modules
ode-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download: https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v48 ABI) (falling back to source compile with node-gyp)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Platformsx64PlatformToolsetsv140Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and select
ing "Retarget solution". [C:Userssimon
ode_modules
ode-zopfliuildzopfli.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:Program Files (x86)MSBuild14.0inmsbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Userssimon
ode_modules
ode-gyplibuild.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\simon\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\Users\simon\node_modules\node-zopfli\lib\binding\node-v48-win32-x64\zopfli.node" "--module_name=zopfli" "--module_path=C:\Users\simon\node_modules\node-zopfli\lib\binding\node-v48-win32-x64"
gyp ERR! cwd C:Userssimon
ode_modules
ode-zopfli
gyp ERR! node -v v6.6.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:Program Files
odejs
ode.exe C:Userssimon
ode_modules
ode-gypin
ode-gyp.js build --fallback-to-build --module=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64zopfli.node --module_name=zopfli --module_path=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:Userssimon
ode_modules
ode-pre-gyplibutilcompile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 10.0.14393
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\simon\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:Userssimon
ode_modules
ode-zopfli
node-pre-gyp ERR! node -v v6.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.30
node-pre-gyp ERR! not ok
Failed to execute 'C:Program Files
odejs
ode.exe C:Userssimon
ode_modules
ode-gypin
ode-gyp.js build --fallback-to-build --module=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64zopfli.node --module_name=zopfli --module_path=C:Userssimon
ode_modules
ode-zopflilibinding
ode-v48-win32-x64' (1)
npm WARN install:[email protected] [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN install:[email protected] Exit status 1
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm WARN enoent ENOENT: no such file or directory, open 'C:Userssimonpackage.json'
npm WARN @ng-bootstrap/[email protected] requires a peer of @angular/forms@^2.0.0 but none was installed.
npm WARN [email protected] requires a peer of [email protected] || 2.x.x || 2.x.x-beta but none was installed.
npm WARN simon No description
npm WARN simon No repository field.
npm WARN simon No README data
npm WARN simon No license field.

There appears to be more issues.. any more ideas

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had a similar problem on windows, installing node-gyp globally removed those errors.

# before installing node-gyp on windows
npm install --global --production windows-build-tools

# install node-gyp globally
npm install -g node-gyp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...