-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm ERR! Cannot set properties of null (setting 'dev') #4064
Comments
Same problem here. Using Node v17.3.0 and NPM v8.3.0 |
I was able to get around this by doing a |
Same issue but with slightly different repro. Odd thing is in our monorepo some workspaces are working fine. Others yield this error. npm@8.1.2 or npm@8.3.2 |
instead of using a this is a thing we should probably smooth over for users, though, as that's pretty confusing. |
i'm going to close this as a duplicate of #3847 and move the conversation there |
I'm also getting this error when trying to run |
Something else that helped me resolve this issue was just that the |
For our cases of this issue, delete node_modules and rerun npm install seems to be a reliable workaround. |
I was getting this error when trying to link my
Could not get this workaround to work. I tested with node versions What ended up working for me was to go to the package I wanted to test and override the Then, I could link to the package I needed to test and run the app without issues. For example, given the following structure:
Run the following commands:
|
Thank you @nathanpovo , your answer helped me find my answer. I simply had to go to the linked package and install its dependencies. Then I could install the dependencies in my own package without getting this error. One thing is clear: This issue should be reopened so that a better error message could be provided. |
If anyone comes here trying to make a Shopify app by following the QR code example, I eventually discovered I had to run I really wish this error would be updated to something more meaningful, because as it stands it's virtually impossible to figure out what you did wrong without endless googling. I'll also mention issue #3901 since I don't see it mentioned here. |
@Clonkex aaaaand you basically just saved my life. Thank you so much for being as detailed as to include my exact same case. Cheers! |
@Clonkex Thanks, Your solution was really helpful. I had a |
In case anyone else hits this, I had this issue come up after deleting a package in my monorepo. I had a lingering dependency to that now deleted package, and got this error any time I tried to install any additional packages to that workspace. Deleting the lingering dependency in my |
After I deleted one package from ' packages ', I ran into the same thing in a monorepo. All I needed to do was delete |
@nlf Since you closed the issue in #4064 (comment), would you (or some other maintainer) consider re-opening, based on the argument above? There seems to be reliable workarounds, and I think that people are more likely to find them if the issue isn't marked as closed. |
This one is working for me as well. But the problem is that I have to install the modules globally. Is there any solution on it? |
Had a monorepo, some projects had slightly different versions for packages that were symlinked from child project to workspace root (poor mans nohoist within postinstall). Dunno which action certainly resolved the issue, but from the problematic child package:
I also briefly removed my postinstall step ( |
so I had a local react-library-app and a react-consumer-app and the lib was being consumed by npm link, and because both apps had their own react installed on their node_modules, I was getting a react error tried to npm link the react installation from one app to another then got this error inspired by @nathanpovo fix all I just did was a |
For me the error was shown after trying to do a I ran |
Worked perfectly for me. Thanks a lot |
Happened to me because I didn't initialize a workspace and tried to |
I encountered this when accidentally committing a "file:../projectX" dependency that I was using temporarily for local development. Easy fix once I deciphered the confusing error message. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm install
does not work if try to install one workspace to anotherSTR:
mkdir foo && cd ./foo
npm init -y
npm init -y -w ./pkg-a
npm init -y -w ./pkg-b
npm install ./pkg-a -w pkg-b
AR:
npm ERR! Cannot set properties of null (setting 'dev')
ER: Behaviour similar to
cd ./pkg-b && npm install ../pkg-a
Expected Behavior
No response
Steps To Reproduce
No response
Environment
The text was updated successfully, but these errors were encountered: