本地 npm 依赖在之前工作后中断 [英] Local npm dependency breaks after previously working
问题描述
我今天一直在处理一个本地项目以及项目中使用的本地 npm 包.我的项目一整天都运行良好,使用 npm install ../mylib
安装库时也是如此.不幸的是,由于我的包中出现了一些看起来像是依赖问题的问题,该项目现在无法运行.我将项目和包都回滚到我知道可以工作的状态,但是,我继续遇到下面的破坏性错误.如果它有所作为,我最近一直在交替使用 npm 和 yarn.
I've been working today on a local project and also a local npm package used in the project. My project has been running fine all day and so has the library when installed using npm install ../mylib
. Unfortunately, the project is now not working due to some issue in my package that looks like a dependency problem. I rolled both the project and the package back to a state I knew to be working, however, I continue to get the breaking error below. If it makes a difference, I have been using npm and yarn interchangeably recently.
webpack output is served from /
404s will fallback to /index.html
(node:18785) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
webpack: wait until bundle finished: /abc/foo
######/node_modules/ng-annotate/build/es5/scope.js:111
Scope.prototype.getNode = function(name) {
^
Error: StringMap expected string key
at stringmap.set (######/node_modules/stringmap/stringmap.js:99:19)
at Scope.add (######/node_modules/ng-annotate/build/es5/scope.js:102:17)
at ######/node_modules/ng-annotate/build/es5/scopetools.js:65:25
at Array.forEach (native)
at createScopes (######/node_modules/ng-annotate/build/es5/scopetools.js:64:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:25:19)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
at visit (######/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! project@0.0.1 dev: `webpack-dev-server --https --port 9090`
npm ERR! Exit status 1
我尝试删除 node_modules
并重新安装等,但无济于事.非常感谢任何帮助.
I've tried deleting node_modules
and reinstalling etc but to no avail. Any help is greatly appreciated.
推荐答案
我不确定这是否是完整的答案,但我怀疑我在删除 package-lock.json
和yarn.lock
在再次运行安装并运行项目之前从我的项目中删除.
I'm not sure if this is the complete answer but I suspect that I fixed this my removing package-lock.json
and yarn.lock
from my project before running the install again and running the project.
这篇关于本地 npm 依赖在之前工作后中断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!