Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while NPM INSTALL inside angular project

We are a team working on a angular project. After downloading the code from repo, when I try to run $npm install, im facing the following error.

I have tried installing node-gyp, node-sass, deleted node_modules under project directory but nothing resolves the issue while executing $npm install

../src/create_string.cpp: In function ‘char* create_string(Nan::MaybeLocal)’: ../src/create_string.cpp:17:37: error: no matching function for call to v8::String::Utf8Value::Utf8Value(v8::Local&)’ v8::String::Utf8Value string(value); ^

In file included from /home/pc-username/.node-gyp/12.7.0/include/node/node.h:63:0,

             from ../../../../../nan/nan.h:54,
             from ../src/create_string.cpp:1:
/home/pc-username/.node-gyp/12.7.0/include/node/v8.h:3002:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
     Utf8Value(Isolate* isolate, Local<v8::Value> obj);
     ^~~~~~~~~

/home/pc-username/.node-gyp/12.7.0/include/node/v8.h:3002:5: note: candidate expects 2 arguments, 1 provided binding.target.mk:127: recipe for target 'Release/obj.target/binding/src/create_string.o' failed

make: *** [Release/obj.target/binding/src/create_string.o] Error 1
make: Leaving directory '/home/pc-username/project-folder/project-name/node_modules/@angular-devkit/build-angular/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/pc-username/project-folder/project-name/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.18.0-25-generic
gyp ERR! command "/usr/lib/node_modules/node/bin/node" "/home/pc-username/project-folder/project-name/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/pc-username/project-folder/project-name/node_modules/@angular-devkit/build-angular/node_modules/node-sass
gyp ERR! node -v v12.7.0
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 ajv@^6.9.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of font-awesome@^4.7.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself. 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":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular-devkit/build-angular/node_modules/node-sass): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node scripts/build.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

audited 46047 packages in 162.363s found 641 vulnerabilities (1 low, 640 high) runnpm audit fixto fix them, ornpm auditfor details

Can someone point me what the problem is?

Regards, Ananth S

like image 501
user3391612 Avatar asked Jul 30 '19 04:07

user3391612


1 Answers

Face same issues before probably the issue is from node sass.

Try to delete your package.json.lock and run npm install.

Refer to this link: https://github.com/sass/node-sass/issues/1991

like image 115
Poldo Avatar answered Sep 21 '22 11:09

Poldo