Error command sh c node scripts build js

I'm getting the following errors whenever I run npm install on a vue.js project 5769 error code 1 5770 error path /*my path*/node_modules/node-sass 5771 error command failed 5772 error command sh -...

I’m getting the following errors whenever I run npm install on a vue.js project

5769 error code 1
5770 error path /*my path*/node_modules/node-sass
5771 error command failed
5772 error command sh -c node scripts/install.js
5773 error /*my path*/node_modules/request/index.js:30
5773 error   if (options !== null && typeof op
5773 error
5773 error
5773 error SyntaxError: Unexpected end of input
5773 error     at Object.compileFunction (node:vm:352:18)
5773 error     at wrapSafe (node:internal/modules/cjs/loader:1031:15)
5773 error     at Module._compile (node:internal/modules/cjs/loader:1065:27)
5773 error     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
5773 error     at Module.load (node:internal/modules/cjs/loader:981:32)
5773 error     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
5773 error     at Module.require (node:internal/modules/cjs/loader:1005:19)
5773 error     at require (node:internal/modules/cjs/helpers:102:18)
5773 error     at Object.<anonymous> (/*my path*/node_modules/node-sass/scripts/install.js:10:13)
5773 error     at Module._compile (node:internal/modules/cjs/loader:1101:14)
5774 verbose exit 1

I’ve tried reinstalling node and npm, but it always seems to stop on node-sass.
npm install runs just fine on all my laravel projects. This only happens on the two projects that I’ve pulled recently that almost entirely Vue.js and typescript so I’m not sure if that may be the issue.

Edit: I tried delete my local version, pull from github and run npm install again and got this error. It was a bit of a mammoth error so I’ve had to delet a big chunk of it to fit it into the post.

2863 error code 1
2864 error path /*my path*/node_modules/node-sass
2865 error command failed
2866 error command sh -c node scripts/build.js
2867 error Building: /opt/homebrew/Cellar/node/16.10.0/bin/node /Users/scott/Dev/KPro/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
2867 error   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/scott/.node-gyp/16.10.0/include/node -I/Users/scott/.node-gyp/16.10.0/src -I/Users/scott/.node-gyp/16.10.0/deps/openssl/config -I/Users/scott/.node-gyp/16.10.0/deps/openssl/openssl/include -I/Users/scott/.node-gyp/16.10.0/deps/uv/include -I/Users/scott/.node-gyp/16.10.0/deps/zlib -I/Users/scott/.node-gyp/16.10.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
2867 error   c++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/scott/.node-gyp/16.10.0/include/node -I/Users/scott/.node-gyp/16.10.0/src -I/Users/scott/.node-gyp/16.10.0/deps/openssl/config -I/Users/scott/.node-gyp/16.10.0/deps/openssl/openssl/include -I/Users/scott/.node-gyp/16.10.0/deps/uv/include -I/Users/scott/.node-gyp/16.10.0/deps/zlib -I/Users/scott/.node-gyp/16.10.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast_fwd_decl.o ../src/libsass/src/ast_fwd_decl.cpp

2868 error gyp info it worked if it ends with ok
2868 error gyp verb cli [
2868 error gyp verb cli   '/opt/homebrew/Cellar/node/16.10.0/bin/node',
2868 error gyp verb cli   '/*my path*/node_modules/node-gyp/bin/node-gyp.js',
2868 error gyp verb cli   'rebuild',
2868 error gyp verb cli   '--verbose',
2868 error gyp verb cli   '--libsass_ext=',
2868 error gyp verb cli   '--libsass_cflags=',
2868 error gyp verb cli   '--libsass_ldflags=',
2868 error gyp verb cli   '--libsass_library='
2868 error gyp verb cli ]
2868 error gyp info using node-gyp@3.8.0
2868 error gyp info using node@16.10.0 | darwin | arm64
2868 error gyp verb command rebuild []
2868 error gyp verb command clean []
2868 error gyp verb clean removing "build" directory
2868 error gyp verb command configure []
2868 error gyp verb check python checking for Python executable "python2" in the PATH
2868 error gyp verb `which` succeeded python2 /usr/bin/python2
2868 error gyp verb check python version `/usr/bin/python2 -c "import sys; print "2.7.16
2868 error gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
2868 error gyp verb get node dir no --target version specified, falling back to host node version: 16.10.0
2868 error gyp verb command install [ '16.10.0' ]
2868 error gyp verb install input version string "16.10.0"
2868 error gyp verb install installing version: 16.10.0
2868 error gyp verb install --ensure was passed, so won't reinstall if already installed
2868 error gyp verb install version is already installed, need to check "installVersion"
2868 error gyp verb got "installVersion" 9
2868 error gyp verb needs "installVersion" 9
2868 error gyp verb install version is good
2868 error gyp verb get node dir target node version installed: 16.10.0
2868 error gyp verb build dir attempting to create "build" dir: /Users/scott/Dev/KPro/node_modules/node-sass/build
2868 error gyp verb build dir "build" dir needed to be created? /Users/scott/Dev/KPro/node_modules/node-sass/build
2868 error gyp verb build/config.gypi creating config file
2868 error gyp verb build/config.gypi writing out config file: /*my path*/node_modules/node-sass/build/config.gypi
2868 error (node:57324) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
2868 error (Use `node --trace-deprecation ...` to show where the warning was created)
2868 error gyp verb config.gypi checking for gypi file: /*my path*/node_modules/node-sass/config.gypi
2868 error gyp verb common.gypi checking for gypi file: /*my path*/node_modules/node-sass/common.gypi
2868 error gyp verb gyp gyp format was not specified; forcing "make"
2868 error gyp info spawn /usr/bin/python2
2868 error gyp info spawn args [
2868 error gyp info spawn args   '/*my path*/node_modules/node-gyp/gyp/gyp_main.py',
2868 error gyp info spawn args   'binding.gyp',
2868 error gyp info spawn args   '-f',
2868 error gyp info spawn args   'make',
2868 error gyp info spawn args   '-I',
2868 error gyp info spawn args   '/*my path*/node_modules/node-sass/build/config.gypi',
2868 error gyp info spawn args   '-I',
2868 error gyp info spawn args   '/*my path*/node_modules/node-gyp/addon.gypi',
2868 error gyp info spawn args   '-I',
2868 error gyp info spawn args   '/Users/scott/.node-gyp/16.10.0/include/node/common.gypi',
2868 error gyp info spawn args   '-Dlibrary=shared_library',
2868 error gyp info spawn args   '-Dvisibility=default',
2868 error gyp info spawn args   '-Dnode_root_dir=/Users/scott/.node-gyp/16.10.0',
2868 error gyp info spawn args   '-Dnode_gyp_dir=/Users/scott/Dev/KPro/node_modules/node-gyp',
2868 error gyp info spawn args   '-Dnode_lib_file=/Users/scott/.node-gyp/16.10.0/<(target_arch)/node.lib',
2868 error gyp info spawn args   '-Dmodule_root_dir=/*my path*/node_modules/node-sass',
2868 error gyp info spawn args   '-Dnode_engine=v8',
2868 error gyp info spawn args   '--depth=.',
2868 error gyp info spawn args   '--no-parallel',
2868 error gyp info spawn args   '--generator-output',
2868 error gyp info spawn args   'build',
2868 error gyp info spawn args   '-Goutput_dir=.'
2868 error gyp info spawn args ]
2868 error gyp verb command build []
2868 error gyp verb build type Release
2868 error gyp verb architecture arm64
2868 error gyp verb node dev dir /Users/scott/.node-gyp/16.10.0
2868 error gyp verb `which` succeeded for `make` /usr/bin/make
2868 error gyp info spawn make
2868 error gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]

2868 error 2 warnings generated.
2868 error In file included from ../src/libsass/src/ast_fwd_decl.cpp:1:
2868 error ../src/libsass/src/ast.hpp:1614:25: warning: loop variable 'numerator' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-construct]
2868 error         for (const auto numerator : numerators)
2868 error                         ^
2868 error ../src/libsass/src/ast.hpp:1614:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
2868 error         for (const auto numerator : numerators)
2868 error              ^~~~~~~~~~~~~~~~~~~~~~
2868 error                         &
2868 error ../src/libsass/src/ast.hpp:1616:25: warning: loop variable 'denominator' creates a copy from type 'const std::__1::basic_string<char>' [-Wrange-loop-construct]
2868 error         for (const auto denominator : denominators)
2868 error                         ^
2868 error ../src/libsass/src/ast.hpp:1616:14: note: use reference type 'const std::__1::basic_string<char> &' to prevent copying
2868 error         for (const auto denominator : denominators)
2868 error              ^~~~~~~~~~~~~~~~~~~~~~~~



2868 error                                      remove_cv
2868 error /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: 'remove_cv' declared here
2868 error template <class _Tp> struct _LIBCPP_TEMPLATE_VIS remove_cv
2868 error                                                  ^
2868 error 1 error generated.
2868 error make: *** [Release/obj.target/binding/src/binding.o] Error 1
2868 error gyp ERR! build error
2868 error gyp ERR! stack Error: `make` failed with exit code: 2
2868 error gyp ERR! stack     at ChildProcess.onExit (/*my path*/node_modules/node-gyp/lib/build.js:262:23)
2868 error gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
2868 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
2868 error gyp ERR! System Darwin 20.6.0
2868 error gyp ERR! command "/opt/homebrew/Cellar/node/16.10.0/bin/node" "/*my path*/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
2868 error gyp ERR! cwd /*my path*/node_modules/node-sass
2868 error gyp ERR! node -v v16.10.0
2868 error gyp ERR! node-gyp -v v3.8.0
2868 error gyp ERR! not ok
2868 error Build failed with error code: 1
2869 verbose exit 1

Содержание

  1. How to solve npm ERR! code 1 when running npm install
  2. Fix npm error code 1 by updating your dependencies
  3. Fix npm error code 1 by downgrading Node (not recommended)
  4. Level up your programming skills
  5. About
  6. npm install fails due to node-gyp errors #2113
  7. Comments
  8. Recieve error when install node-sass by yarn . #1781
  9. Comments
  10. Bus error (core dumped) #1857
  11. Comments

How to solve npm ERR! code 1 when running npm install

Posted on Jun 24, 2022 Photo from Unsplash

The npm ERR! code 1 error usually occurs when you run the npm install command.

This cause of this error is that one of the dependencies you define in your package.json file fails to be installed properly on your computer.

The error message log looks as follows:

In the example above, you can see that there is an npm ERR! path. defined right below the code 1 log:

This means that npm fails to install the node-sass module that’s added as a dependency to the n-app project.

To resolve this error, you need to upgrade the dependency module that causes the error.

Let’s learn how to fix this error next.

Fix npm error code 1 by updating your dependencies

Here’s the package.json file of the n-app project:

As you can see, there’s a dependency to the node-sass module version 4.14.1 in my project.

When looking into the node-sass documentation, I found that there’s a table showing the Node versions supported by the package:

Since I have Node v16.15.1 on my computer, this means I must use node-sass v6.0+ to resolve the issue.

Update the node-sass dependency to the latest version:

Then run npm install again. This time, the dependencies are installed without any error:

It’s always recommended to update all your dependency packages to the latest version to avoid compatibility issues with Node.

You can use npm-check-updates to help you with updating the dependencies:

If you don’t want to update all dependencies at once, you can update them one by one using the npx npm-check-updates output as a reference.

For example, here’s the output for n-app project:

Using the output above:

  • Update one package version in package.json file
  • Then run npm install
  • Make sure your application runs perfectly and pass all tests

Repeat the steps above until you have all package versions updated.

Fix npm error code 1 by downgrading Node (not recommended)

The other way to fix the issue is to downgrade your Node.js version.

In the example above, there are specific Node.js versions supported by specific node-sass versions. You need to make sure that you are using the Node version supported by your module.

This fix is not ideal because you may have other module with compatibility issues once you downgrade Node.

The best way to solve the issue is by updating Node.js and all your dependencies to the latest stable version as explained above.

And that’s how you fix the npm error code 1 issue in your project.

Level up your programming skills

I’m sending out an occasional email with the latest programming tutorials. Drop your email in the box below and I’ll send new stuff straight into your inbox!

About

Nathan Sebhastian is a software engineer with a passion for writing tech tutorials.
Learn JavaScript and other web development technology concepts through easy-to-understand explanations written in plain English.

Источник

npm install fails due to node-gyp errors #2113

  • Node Version: v14.1.0
  • Platform: Microsoft Windows 10 Home, 10.0.18363 Build 10.0.18363
  • Compiler: MSBuild 15.0, using VS 2019 and Python 3
  • Module: Any module, in this case robotjs

Verbose output (from npm or node-gyp):

npm —verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli ‘C:nodejsnode.exe’,
npm verb cli ‘C:nodejsnode_modulesnpmbinnpm-cli.js’,
npm verb cli ‘—verbose’
npm verb cli ]
npm info using npm@6.14.4
npm info using node@v14.1.0

where is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami

npm -h quick help on
npm -l display full usage info
npm help search for help on
npm help npm involved overview

Specify configs in the ini-formatted file:
C:UsersShubham Bhardwaj.npmrc
or on the command line via: npm —key value
Config info can be viewed via: npm help config

Error Description > robotjs@0.6.0 install C:nodejsnode_modulesrobotjs > prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.1.0 runtime=node arch=x64 libc= platform=win32)
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildCurrentBinMSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:468:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:84:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command «C:nodejsnode.exe» «C:nodejsnode_modulesnode-gypbinnode-gyp.js» «rebuild»
gyp ERR! cwd C:nodejsnode_modulesrobotjs
gyp ERR! node -v v14.1.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! This is a bug in node-gyp .
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/nodejs/node-gyp/issues
npm ERR! code ELIFECYCLE
npm ERR! errno 7
npm ERR! robotjs@0.6.0 install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 7
npm ERR!
npm ERR! Failed at the robotjs@0.6.0 install 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:UsersShubham BhardwajAppDataRoamingnpm-cache_logs2020-05-03T09_31_41_003Z-debug.log

I tried a lot of solutions, but of no use.
Please guide the way forward. I’ve been stuck on this for 2-3 days now.

The text was updated successfully, but these errors were encountered:

@cclauss @vadimpopa Can you suggest some way out please?

What do you get when you run

(include the quotes) in the console?

What do you get when you run

(include the quotes) in the console?

Same problem here.
I’ve run MSBuild.exe.

Here’s the output:

C:WorkIonic>»c:Program Files (x86)Microsoft Visual Studio2019ProfessionalMSBuildCurrentBinMSBuild.exe»
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.

@bzoz I get the same output on the console as @Youkko ! Any insight on what’s causing this?

I am also getting same issue. anyone tried a lower version than 2019 MsVS?

I dont know if I am going in the correct direction. But I installed MSVS 20115 yesterday and retried

I am getting a different error now because of node-pty

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».

Got rid of this error by changing Node.JS version (from 8.x to 10.x).

What do you get when you run

(include the quotes) in the console?

I’m getting this: «The system cannot find the path specified.»

What do you get when you run

(include the quotes) in the console?

I’m getting this: «The system cannot find the path specified.»

Make sure you have that Visual Studio version. You’re trying to execute MSBuild.exe from Visual Studio Community edition’s folder. Do you have it installed in this folder?
I use Visual Studio Professional, so mine is in a different folder
(c:Program Files (x86)Microsoft Visual Studio2019 Professional MSBuildCurrentBinMSBuild.exe)
Change this file location to your visual studio folder and you should get it.

@ShubhamB99 could you provide the entire verbose log including the command you are using? Add —verbose to whatever npm command you are using that causes this issue.

@Youkko @TulasiJagan49, @nandas your issues could be completely unrelated. Please provide the entire verbose log and your system configuration — basically fill out the issue template. Fell free to open separate issues.

@nandas VS2019 works just fine with node-gyp, no need to downgrade.

This works for me 🙂

Is this issue is solved?

@ShubhamB99 did you ever solve this issue? I know it was a while ago but I am running into a very similar problem now.

@gideonm-pangea what are you trying to do (provide a command you are trying to run, but with —verbose flag). And then provide the output of command. Please, formate output as code snippet (put it into «` (triple backquote on an otherwise blank line before and after command output))

@owl-from-hogvarts I myself am not currently having this issue but I do remember that I fixed it, don’t remember how. it seems like these errors aren’t caused by a bug but by node-gyp being improperly set up by the user, but I do think that maybe the error messages should be a bit more descriptive as to the error and the solution.

How I can make it work?

@reduardo7 what npm version do you use? and what output did you get?

@owl-from-hogvarts Thank you for your help!

Here more details:

Not working, help me please. Im installing tars-cli and get errors. (python — inst, Visual studio installer and C++ — inst )

Источник

Recieve error when install node-sass by yarn . #1781

I have installed node-sass by yarn, but I get error:

Could you please let me know to fix this error ?

The text was updated successfully, but these errors were encountered:

@nschonni this also looks tangentially related to the cache patch. My guess is yarn isn’t BC with npm config.

@NicolasAndersen what version of yarn are you using?

@xzyfer I’m having the same issue on yarn v0.16.1

Modifying the yarn.lock file back to node-sass version 3.10.0 is the temporary workaround I’m using right now.

Thanks @scottcarlson this is a bug in yarn that was exposed by a recent change in node-sass.

Opened an issue with yarn — yarnpkg/yarn#1632

thank @xzyfer and @scottcarlson . I using yarn version 0.16.1. I have removed folder node_modules then use npm install and it worked. Thank you again. You can close this ticket.

I’ll leave this open. This is an issue for yarn support.

I just solved it by setting the cache config to yarn. It seems like yarn does set all npm_config_* env vars, but cache doesn’t exist by default.

$ yarn config set cache

Interesting observation @daltones. That’s a case we currently do no handle gracefully.

I have a work around in #1782.

Thanks for the workaround, @daltones. This worked for me:

yarn cache dir returns the current cache dir.

I’ve released v3.11.1 with a patch until yarn is fixed.

this command helped me a lot
yarn —cache-folder

so here is the story:
i was downloading a new repo from github.. the instractions of instalation tell that i should install yarn globaly and then execute yarn
npm i -g yarn && yarn
after that i had an erro like
yarn install v1.9.4 [1/6] Validating package.json. [2/6] Resolving packages. [3/6] Fetching packages. info There appears to be trouble with your network connection. Retrying. info fsevents@1.1.3: The platform «linux» is incompatible with this module. info «fsevents@1.1.3» is an optional dependency and failed compatibility check. Excluding it from installation. [4/6] Linking dependencies. [5/6] Building fresh packages. [-/5] ⠠ waiting. [-/5] ⠠ waiting. [-/5] ⠠ waiting. [4/5] ⠐ node-sass error /media/root/dev/programmation/dev web/trudesk/node_modules/node-sass: Command failed. Exit code: 135 Command: node scripts/build.js Arguments: Directory: /media/root/dev/programmation/dev web/trudesk/node_modules/node-sass Output: Binary found at /media/root/dev/programmation/dev web/trudesk/node_modules/node-sass/vendor/linux-x64-57/binding.node

i saw all comments here and i found the answer of @jbruni (thank you man by the way 🙂 ) but it could help me.. so when i did yarn —help i found —cache-folder

for specifying cache folder . the magic happened .. all my problem solved and the result was like

Источник

Bus error (core dumped) #1857

Whenever I run the ember command I get a: Bus error (core dumped). I’ve tried with both v7.3.0 and v7.4.0 of node.js with the same results. When I downgrade to node v6.9.4 the error goes away. So this is probably an issue with new code in the node 7.x branch. I’ll open a bug there referencing this as well.

Output from ember version —verbose && npm —version :

The text was updated successfully, but these errors were encountered:

Can you get s stack backtrace with gdb ?

same issue with yarn install
error /home/jhipster/app/node_modules/node-sass: Command failed.
Exit code: 135
Command: sh
Arguments: -c node scripts/build.js
Directory: /home/jhipster/app/node_modules/node-sass
Output:
Binary found at /home/jhipster/app/node_modules/node-sass/vendor/linux-x64-48/binding.node
Testing binary
Bus error (core dumped)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

then I tryed npm:
Bus error (core dumped)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.0.17: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»linux»,»arch»:»x64″>)
npm ERR! Linux 4.2.0-16-generic
npm ERR! argv «/usr/bin/nodejs» «/usr/bin/npm» «install» «node-sass» «—registry=https://registry.npm.taobao.org»
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 135

npm ERR! node-sass@4.4.0 postinstall: node scripts/build.js
npm ERR! Exit status 135
npm ERR!
npm ERR! Failed at the node-sass@4.4.0 postinstall script ‘node scripts/build.js’.
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 node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

building your project
using yarn
warning fsevents@1.1.1: The platform «linux» is incompatible with this module.
error /opt/app/copy/node_modules/node-sass: Command failed.
Exit code: 135
Command: sh
Arguments: -c node scripts/build.js
Directory: /opt/app/copy/node_modules/node-sass
Output:
Binary found at /opt/app/copy/node_modules/node-sass/vendor/linux_musl-x64-48/binding.node
Testing binary
Bus error
< Error: Command failed: yarn install -s && yarn run build
at checkExecSyncError (child_process.js:483:13)
at execSync (child_process.js:523:13)
at buildProject (/opt/app/generate-target.js:99:9)
at /opt/app/node_modules/async/dist/async.js:3830:24
at replenish (/opt/app/node_modules/async/dist/async.js:946:17)
at iterateeCallback (/opt/app/node_modules/async/dist/async.js:931:17)
at /opt/app/node_modules/async/dist/async.js:906:16
at /opt/app/node_modules/async/dist/async.js:3835:13
at rsync.shell.flags.exclude.source.destination.execute.error (/opt/app/generate-target.js:81:17)
at Rsync. (/opt/app/node_modules/rsync/rsync.js:530:13)
error: null,
cmd: ‘yarn install -s && yarn run build’,
file: ‘/bin/sh’,
args: [ ‘/bin/sh’, ‘-c’, ‘yarn install -s && yarn run build’ ],
options:
< stdio: [ [Object], [Object], [Object] ],
encoding: ‘utf8’,
shell: true,
file: ‘/bin/sh’,
args: [ ‘/bin/sh’, ‘-c’, ‘yarn install -s && yarn run build’ ],
envPairs:
[ ‘PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’,
‘HOSTNAME=5b8e812a6cfe’,
‘no_proxy=.local, 169.254/16′,
‘HOME=/root’ ] >,
envPairs:
[ ‘PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’,
‘HOSTNAME=5b8e812a6cfe’,
‘no_proxy=
.local, 169.254/16′,
‘HOME=/root’ ],
stderr: null,
stdout: null,
pid: 15,
output: [ null, null, null ],
signal: null,
status: 1 >
✨ Done in 155.24s.

running in a docker alpine linux container

it’s a custom container we use to build our react projects.

it’s dying in this function (and it was working). We’re having some networking issues in my office, so I’ve got other moving parts I need to check:

I changed nothing, and now that our network issue was resolved, all my builds are green.

Источник

npm ERR! gyp info using node-gyp@3.8.0

https://github.com/nodejs/node-gyp/blob/master/docs/README.md

Thank you very much for pointing that out. I have been following the instructions with no success though; node-gyp version still set at 3.8.0 after updating

By looking at the last modification date, I confirmed that the global directory for node-gyp was usersLenovoappdataroamingnpmnode_modulesnode-gyp so I proceeded as follows:

npm i -g node-gyp@latest
for /f "delims=" %P in ('npm prefix -g') do npm config set node_gyp "%PusersLenovoappdataroamingnpmnode_modulesnode-gypbinnode-gyp.js"
npm config set msvs_version 2019

Must be doing something silly here but cannot figure it out… any idea? Also downgraded node to 14.17.0 and installed visual studio 2019 with desktop c++

npm ERR! code 1
npm ERR! path C:suplai-asistentenode_modulesnode-sass
npm ERR! command failed
npm ERR! command C:WINDOWSsystem32cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:Program Files (x86)nodejsnode.exe C:suplai-asistentenode_modulesnode-gypbinnode-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\Program Files (x86)\nodejs\node.exe',
npm ERR! gyp verb cli   'C:\suplai-asistente\node_modules\node-gyp\bin\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.17.0 | win32 | ia32
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "C:UsersLenovo.windows-build-toolspython27" in the PATH
npm ERR! gyp verb `which` failed Error: not found: C:UsersLenovo.windows-build-toolspython27
npm ERR! gyp verb `which` failed     at getNotFoundError (C:suplai-asistentenode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:suplai-asistentenode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:suplai-asistentenode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:192:21)
npm ERR! gyp verb `which` failed  C:UsersLenovo.windows-build-toolspython27 Error: not found: C:UsersLenovo.windows-build-toolspython27
npm ERR! gyp verb `which` failed     at getNotFoundError (C:suplai-asistentenode_moduleswhichwhich.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:suplai-asistentenode_moduleswhichwhich.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:suplai-asistentenode_moduleswhichwhich.js:80:29)
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_moduleswhichwhich.js:89:16
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_modulesisexeindex.js:42:5
npm ERR! gyp verb `which` failed     at C:suplai-asistentenode_modulesisexewindows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:192:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "C:UsersLenovo.windows-build-toolspython27". checking python launcher
npm ERR! gyp verb check python launcher python executable found: "C:\Users\Lenovo\.windows-build-tools\python27\python.exe"
npm ERR! gyp verb check python version `C:UsersLenovo.windows-build-toolspython27python.exe -c "import sys; print "2.7.15
npm ERR! gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 14.17.0
npm ERR! gyp verb command install [ '14.17.0' ]
npm ERR! gyp verb install input version string "14.17.0"
npm ERR! gyp verb install installing version: 14.17.0
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 14.17.0
npm ERR! gyp verb build dir attempting to create "build" dir: C:suplai-asistentenode_modulesnode-sassbuild
npm ERR! gyp verb build dir "build" dir needed to be created? C:suplai-asistentenode_modulesnode-sassbuild
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:suplai-asistentenode_modulesnode-sassbuildconfig.gypi
npm ERR! gyp verb config.gypi checking for gypi file: C:suplai-asistentenode_modulesnode-sassconfig.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:suplai-asistentenode_modulesnode-sasscommon.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:UsersLenovo.windows-build-toolspython27python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\suplai-asistente\node_modules\node-gyp\gyp\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-G',
npm ERR! gyp info spawn args   'msvs_version=2019',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\suplai-asistente\node_modules\node-sass\build\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\suplai-asistente\node_modules\node-gyp\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\Users\Lenovo\.node-gyp\14.17.0\include\node\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\Users\Lenovo\.node-gyp\14.17.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\suplai-asistente\node_modules\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\Users\Lenovo\.node-gyp\14.17.0\<(target_arch)\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\suplai-asistente\node_modules\node-sass',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\suplai-asistente\node_modules\node-sass\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgypgyp_main.py", line 16, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgyp__init__.py", line 545, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgyp__init__.py", line 538, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgyp__init__.py", line 514, in gyp_main
npm ERR!     options.duplicate_basename_check)
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgyp__init__.py", line 98, in Load
npm ERR!     generator.CalculateVariables(default_variables, params)
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgypgeneratormsvs.py", line 1916, in CalculateVariables
npm ERR!     generator_flags.get('msvs_version', 'auto'))
npm ERR!   File "C:suplai-asistentenode_modulesnode-gypgyppylibgypMSVSVersion.py", line 434, in SelectVisualStudioVersion
npm ERR!     versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
npm ERR! KeyError: '2019'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:suplai-asistentenode_modulesnode-gyplibconfigure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\suplai-asistente\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:suplai-asistentenode_modulesnode-sass
npm ERR! gyp ERR! node -v v14.17.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersLenovoAppDataLocalnpm-cache_logs2021-12-16T01_21_42_000Z-debug-0.log```



I cloned my repo to revisit an old gatsby project i created on another computer, however when i tried to run the local development server I got this error:

 ERROR 

There was a problem loading the local develop command. Gatsby may not be installed in your site's "node_modules" directory. Perhaps you need to run "npm install"? You might need to delete your
"package-lock.json" as well.

I’ve installed gatsby already so i ran a npm install but it failed once it got to the node-sass portion in the log. Here’s an excerpt of where the error begins:

4338 verbose stack Error: command failed
4338 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
4338 verbose stack     at ChildProcess.emit (node:events:527:28)
4338 verbose stack     at maybeClose (node:internal/child_process:1090:16)
4338 verbose stack     at Socket.<anonymous> (node:internal/child_process:449:11)
4338 verbose stack     at Socket.emit (node:events:527:28)
4338 verbose stack     at Pipe.<anonymous> (node:net:715:12)
4339 verbose pkgid node-sass@4.14.1
4340 verbose cwd /Users/kentonscott/Documents/KS/Coding/Repositories/My-Portfolio
4341 verbose Darwin 21.2.0
4342 verbose node v18.0.0
4343 verbose npm  v8.6.0
4344 error code 1
4345 error path /Users/kentonscott/Documents/KS/Coding/Repositories/My-Portfolio/node_modules/node-sass
4346 error command failed
4347 error command sh -c node scripts/build.js    

I realized on this new computer I installed node v18 and the node-sass version in the package-json is 4.14.1 that maybe I need to revert the node version to v14 for the package-lock.json to work. I’m not sure if this is correct though, but how would I revert the node version to work just for this project?

Thanks!

Уже 2 раза сталкивался с ошибкой установки node sass.

Через npm лог выглядит так:

npm ERR! node-sass@4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.9.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Через yarn так:

error <...>node_modulesnode-sass: Command failed.
Exit code: 1
Command: node scripts/build.js

Решение

npm rebuild node-sass

Как обновить npm и пакеты npm ?

Обновление npm через npm + команда для обновления пакета на примере angular cli (глобально).

Добыча данных с сайтов (web scraping)

Youtube запись доклада Егора Малькевича о способах утащить данные с сайта используя Puppeteer (NodeJS)

Не сравнивать package-lock.json между ветками

Создать/отредактировать файл .gitattributes, где указать, что package-lock.json является бинарным файлом.

package-lock.json binary

npm set registry

npm set registry https://registry.npmjs.org/

Git. Добавление имени ветки к сообщению коммита

Использование git commit-msg хука + husky + скрипт на nodejs для добавления имени ветки к сообщению коммита

Анализ размера npm пакета.

  • Bundlephobia
  • Import Cost
  • cost-of-modules

#javascript #npm #gulp #package.json #node-sass

Вопрос:

Для проекта я использую gulp и различные зависимости. Несколько месяцев назад я смог работать с ним без каких-либо осложнений. После переустановки моей операционной системы я теперь получаю сообщение об ошибке, что node-sass не может быть установлен. Node, NPM и NPX находятся в последней версии

Попытался исправить это с npm install помощью , npm rebuild , npm rebuild node-sass и удаления папки package-lock.json/node_modules и переустановил ее. Все еще получаю ту же ошибку:

 npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /Users/skayan/Sites/gulpino/node_modules/node-sass
npm ERR! command failed
npm ERR! command sh -c node scripts/build.js
npm ERR! Building: /usr/local/Cellar/node/16.8.0/bin/node /Users/skayan/Sites/gulpino/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR!   c   '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.5.5"' -I/Users/skayan/.node-gyp/16.8.0/include/node -I/Users/skayan/.node-gyp/16.8.0/src -I/Users/skayan/.node-gyp/16.8.0/deps/openssl/config -I/Users/skayan/.node-gyp/16.8.0/deps/openssl/openssl/include -I/Users/skayan/.node-gyp/16.8.0/deps/uv/include -I/Users/skayan/.node-gyp/16.8.0/deps/zlib -I/Users/skayan/.node-gyp/16.8.0/deps/v8/include -I../src/libsass/include  -O3 -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c  11 -stdlib=libc   -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
....
 

В терминале он всегда останавливается здесь:

 ⸨##################⸩ ⠹ reify:node-sass: timing reify:audit Completed in 1139ms
 

В строке состояния написано следующее:

 clang <- npm install gulp-sass
 

Это как-то связано с конфликтом версий или как мне исправить эту ошибку?

Комментарии:

1. Какая версия node у вас есть и какую node-sass версию вы пытаетесь установить ? Вы пробовали удалить node_modules папку и установить ее снова ?

2. узел находится на версии 16.8.0, и node-sass не указан в моей зависимости, поэтому я предполагаю, что npm-установка принимает последнюю версию. gulp-sass 4.1.0 указан в моем списке зависимостей. Да, как я уже писал выше, я уже пытался удалить и установить его снова. Но если удалить «gulp-sass»: «4.1.0» из моего списка зависимостей, установите npm

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Error command returned non zero exit status 1
  • Error command npm run build exited with 126
  • Error command not found rage mp
  • Error command is not a valid attribute for a play
  • Error command give not found перевод

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии