I'm having a weird issue with npm install. When I run 'npm install bones', it's pulling in an old version of underscore (1.1.7) instead of the latest (1.4.2). This old version has bugs that are messing up my code.
What's even stranger is that 'npm install underscore' in the bones folder does the same thing. But if I try it outside that folder, it gets the right version.
I checked the bones package info and it says it should use the new version. I'm stumped! Any ideas how to fix this without having to clone the repo? I'd rather avoid that if possible.
Has anyone else run into this problem or know what might be causing it? I'd really appreciate any help or suggestions!
This issue likely stems from a specific version constraint in bones’ dependencies. I’d recommend examining the package.json file within the bones directory. Look for any hard-coded version numbers or ranges that might be forcing the use of older packages.
If that doesn’t reveal anything, try running ‘npm outdated’ in the project root to see which packages have newer versions available. You might need to update bones itself to a version that supports the latest underscore.
As a last resort, you could consider using npm’s ‘overrides’ feature in your own package.json to force a specific underscore version. However, be cautious with this approach as it might lead to compatibility issues with bones.
yo, sounds like a pain. sometims npm can be weird with versioning. have u tried deletin ur node_modules folder and package-lock.json, then reinstalling everything? that mite force it to grab the latest stuff. if not, maybe check if bones has sum specific version requirements burried in its dependencys.
I’ve encountered similar issues with npm and outdated dependencies before. It’s frustrating when package versions don’t align as expected. In your case, it sounds like there might be a version conflict or a nested dependency causing the problem.
One thing you could try is clearing your npm cache with ‘npm cache clean --force’ and then running ‘npm install’ again. Sometimes cached data can interfere with getting the latest versions.
Another approach is to explicitly specify the underscore version you want in your package.json file. Add a line like ‘“underscore”: “^1.4.2”’ under dependencies.
If those don’t work, you might need to dig into the bones package’s dependencies to see if there’s a sub-dependency pulling in the old underscore version. The ‘npm ls underscore’ command can help identify where it’s coming from.
Hope one of these suggestions helps resolve the issue for you!