Everything works fine when running and building the app, but I cannot publish a new version of custom-react-scripts on npm
npm run publish fails because of some issue with npm dedupe. I've tried multiple versions of npm and node but nothing works. This might be the issue.
This is the log:
266 silly doSerial move 1
267 silly move /Users/kitze/webdev/libs/custom-react-scripts/packages/react-scripts/node_modules/babel-preset-react-app/node_modules/babel-preset-es2015 /Users/kitze/webdev/libs/custom-react-scripts/packages/react-scripts/node_modules/babel-preset-es2015
268 info lifecycle undefined~preuninstall: undefined
269 verbose stack TypeError: Cannot read property 'length' of undefined
269 verbose stack at _incorrectWorkingDirectory (/Users/kitze/.nvm/versions/node/v7.1.0/lib/node_modules/npm/lib/utils/lifecycle.js:87:59)
269 verbose stack at /Users/kitze/.nvm/versions/node/v7.1.0/lib/node_modules/npm/lib/utils/lifecycle.js:64:39
269 verbose stack at /Users/kitze/.nvm/versions/node/v7.1.0/lib/node_modules/npm/lib/utils/lifecycle.js:187:12
269 verbose stack at /Users/kitze/.nvm/versions/node/v7.1.0/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:279:18
269 verbose stack at FSReqWrap.oncomplete (fs.js:111:15)
270 verbose cwd /Users/kitze/webdev/libs/custom-react-scripts/packages/react-scripts
271 error Darwin 15.5.0
272 error argv "/Users/kitze/.nvm/versions/node/v7.1.0/bin/node" "/Users/kitze/.nvm/versions/node/v7.1.0/bin/npm" "dedupe"
273 error node v7.1.0
274 error npm v4.0.2
275 error Cannot read property 'length' of undefined
276 error If you need help, you may report this error at:
276 error <https://github.com/npm/npm/issues>
277 verbose exit [ 1, true ]
Any idea what might be the problem?
Tagging myself to track this.. I think I saw this one or two times when maintaince my fork. I still haven't figured out why the issue gone later.
How about placing a console.log at your /Users/kitze/.nvm/versions/node/v7.1.0/lib/node_modules/npm/lib/utils/lifecycle.js:87:59 to see what is pkg when it failed?
Also, do you use npm link?
Also, is this issue in your create-react-app fork? If so, I can use it to try reproduce the issue 馃槃
Since we are removing bundledDependencies this soon won't be relevant?
Oh right @kitze did remove the bundled dependencies in his fork but not the dedupe command.
@kitze how about taking a look at @fson PR (https://github.com/facebookincubator/create-react-app/pull/1068/files#diff-81eb0e27a6f526dbed9b5fca02979e6c) which remove dedupe altogether?
@gaearon @dvkndn yup, just merged it and it's fine now. Finally 馃帀
Most helpful comment
@gaearon @dvkndn yup, just merged it and it's fine now. Finally 馃帀