gpt4 book ai didi

angular - NPM INSTALL 在 Angular 项目内时出错

转载 作者:行者123 更新时间:2023-12-02 14:14:50 24 4
gpt4 key购买 nike

我们是一个致力于 Angular 项目的团队。从存储库下载代码后,当我尝试运行 $npm install 时,我面临以下错误。

我尝试安装node-gyp,node-sass,删除项目目录下的node_modules,但在执行$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 ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself. npm WARN angular-font-awesome@3.1.2 requires a peer of font-awesome@^4.7.0 but none is installed. You must install peer dependencies yourself. npm WARN bootstrap@4.3.1 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: fsevents@1.2.9 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.10.0 (node_modules/@angular-devkit/build-angular/node_modules/node-sass): npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.10.0 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)
run
npm audit fixto fix them, ornpm auditfor details

有人能指出我的问题是什么吗?

问候,阿南斯·S

最佳答案

在问题可能来自节点 sass 之前面临相同的问题。

尝试删除 package.json.lock 并运行 npm install。

引用此链接:https://github.com/sass/node-sass/issues/1991

关于angular - NPM INSTALL 在 Angular 项目内时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57264201/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com