问题
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
I've tried deleting node_modules
and reinstalling etc but to no avail. Any help is greatly appreciated.
回答1:
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.
来源:https://stackoverflow.com/questions/45273073/local-npm-dependency-breaks-after-previously-working