npm 数据路径“”不应具有其他属性(rebaseRootRelativeCssUrls)

s3fp2yjn  于 2022-12-04  发布在  其他
关注(0)|答案(2)|浏览(112)

我是新的Angular ,我只是想更新一些软件包,并发生这个问题。我一直在寻找这个问题,没有找到一个有用的答案。
错误代码=〉

Schema validation failed with the following errors:
  Data path "" should NOT have additional properties(rebaseRootRelativeCssUrls).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web@1.0.1 start: `ng serve --ssl`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web@1.0.1 start 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\me\AppData\Roaming\npm-cache\_logs\2020-12-21T07_08_11_784Z-debug.log

这里是完整日志=〉

> 0 info it worked if it ends with ok
>     1 verbose cli [
>     1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
>     1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
>     1 verbose cli   'start'
>     1 verbose cli ]
>     2 info using npm@6.14.6
>     3 info using node@v12.18.4
>     4 verbose run-script [ 'prestart', 'start', 'poststart' ]
>     5 info lifecycle web@1.0.1~prestart: web@1.0.1
>     6 info lifecycle web@1.0.1~start: web@1.0.1
>     7 verbose lifecycle web@1.0.1~start: unsafe-perm in lifecycle true
>     8 verbose lifecycle web@1.0.1~start: PATH of Environment
>     9 verbose lifecycle web@1.0.1~start: CWD: C:\me\Project1\web
>     10 silly lifecycle web@1.0.1~start: Args: [ '/d /s /c', 'ng serve --ssl' ]
>     11 silly lifecycle web@1.0.1~start: Returned: code: 1  signal: null
>     12 info lifecycle web@1.0.1~start: Failed to exec start script
>     13 verbose stack Error: web@1.0.1 start: `ng serve --ssl`
>     13 verbose stack Exit status 1
>     13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
>     13 verbose stack     at EventEmitter.emit (events.js:315:20)
>     13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
>     13 verbose stack     at ChildProcess.emit (events.js:315:20)
>     13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
>     13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
>     14 verbose pkgid web@1.0.1
>     15 verbose cwd C:\me\Project1\web
>     16 verbose Windows_NT 10.0.19041
>     17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
>     18 verbose node v12.18.4
>     19 verbose npm  v6.14.6
>     20 error code ELIFECYCLE
>     21 error errno 1
>     22 error web@1.0.1 start: `ng serve --ssl`
>     22 error Exit status 1
>     23 error Failed at the web@1.0.1 start script.
>     23 error This is probably not a problem with npm. There is likely additional logging output above.
>     24 verbose exit [ 1, true ]

请问我能知道为什么会发生这种错误吗?

7xzttuei

7xzttuei1#

我认为package-lock.jsonnode模块是问题的原因。
尝试:
1.删除node-modulespackage-lock.json

  1. npm clean cache --force
  2. npm install
n1bvdmb6

n1bvdmb62#

我通过从angular.json中删除rebaseRootRelativeCssUrls行来解决此问题。

相关问题