Some packages (for instance webpack
) have dependency on packages that are not supported on windows which causes NPM to print warning about it. VS interprets it as generic problem and says that packages are not installed even though in reality this warning should be ignored.
There is an issue about this at npm repo https://github.com/npm/npm/issues/11632 , but meanwhile it would be nice if VS could just ignore these warnings since everything actually works as expected. Also note that I'm using 'leaked' RC2/Preview1 tooling, I'll report back whether this behaviour changed when the proper release is out.
Output while using tools packaged with VS tooling:
PATH=.\node_modules\.bin;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\npm.CMD" install
npm WARN install Couldn't install optional dependency: Unsupported
Output while using newer external tools:
Node v5.11.0
Npm v3.9.0
PATH=.\node_modules\.bin;%PATH%;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External;C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\git
"C:\Program Files\nodejs\npm.CMD" install
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
Confirming that the problem is present in the official release.
TFS: 224850
I've added this to our internal TFS, we will reply back here soon.
@sayedihashimi: Any feedback on this issue?
@Luigie FWIW I think this is an issue in npm rather than VS but they don't seem eager to fix it. Maybe you should add your voice to this issue: npm/npm#11632
I've a work around.
first installed nodejs versions
and installed nodejs
PM> node -v
v6.2.1
PM> npm -v
3.9.3
PM>
the packages are loading now, but message remains
I’m also encountering this problem.
My environment (note the issue occurs both with Visual Studio pointed to its own nodejs installation and pointed to my nodejs installation):
nodejs v6.2.2
(Visual Studio node v5.4.1
)npm v3.9.5
(Visual Studio npm v3.3.4
)gulp-watch
v4.3.5
thru current (even earlier versions not tested).Steps to reproduce:
package.json
.package.json
file. Visual Studio will execute npm.CMD install
.devDependencies { }
:"gulp-watch": "^4.3.8"
4.3.5
thru to ^4.3.8
with the same result.package.json
. Visual Studio will again execute npm.CMD install
.npm install
as a failure. Solution Explorer displays the following:gulp-watch
from package.json
, you won’t be able to get Visual Studio to snap out of this state until you’ve manually deleted node_modules
.npm install
from the command line completes ok
regardless of whether gulp-watch
is referenced (verbose output confirms this), but Visual Studio still won’t update to recognise that the Dependencies and npm are okay.Further notes:
nodejs
installation, or my own nodejs
installation.npm
version, v3.3.4
, Visual Studio’s execution of npm install
reports this message when gulp-watch
is present in the dependencies:npm WARN install Couldn't install optional dependency: Unsupported
This appears related to fsevents
, which I understand is iOS-specific. By running npm install -verbose
in the same path, part of the output is a WARN
(but it still completes with npm info ok
):
npm http 304 https://registry.npmjs.org/fsevents
npm verb headers { date: 'Wed, 29 Jun 2016 14:30:24 GMT',
npm verb headers via: '1.1 varnish',
npm verb headers 'cache-control': 'max-age=300',
npm verb headers etag: '"1QUQVXJX81R6H9MW4OZDK8QZY"',
npm verb headers age: '173',
npm verb headers connection: 'keep-alive',
npm verb headers 'x-served-by': 'cache-akl6420-AKL',
npm verb headers 'x-cache': 'HIT',
npm verb headers 'x-cache-hits': '2',
npm verb headers 'x-timer': 'S1467210624.222315,VS0,VE0',
npm verb headers vary: 'Accept-Encoding' }
npm verb etag https://registry.npmjs.org/fsevents from cache
npm verb get saving fsevents to C:\Users\Geoff\AppData\Roaming\npm-cache\registry.npmjs.org\fsevents\.cache.json
npm WARN install Couldn't install optional dependency: Unsupported
npm verb install Error: Unsupported
npm verb install at checkPlatform (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\npm-install-checks\index.js:46:14)
npm verb install at Array.<anonymous> (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\bind-actor.js:15:8)
npm verb install at LOOP (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\chain.js:15:14)
npm verb install at c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\chain.js:18:7
npm verb install at checkEngine (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\npm-install-checks\index.js:25:10)
npm verb install at Array.<anonymous> (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\bind-actor.js:15:8)
npm verb install at LOOP (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\chain.js:15:14)
npm verb install at chain (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\slide\lib\chain.js:20:5)
npm verb install at module.exports.isInstallable (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\npm\lib\install\validate-args.js:26:3)
npm verb install at resolveWithNewModule (c:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\node_modules\npm\lib\install\deps.js:408:12)
gulp-watch
” which triggers this, out of all the packages I’m working with. The following packages which I am also using are not triggering the issue for me:dependencies:
"@angular/common": "2.0.0-rc.2",
"@angular/compiler": "2.0.0-rc.2",
"@angular/core": "2.0.0-rc.2",
"@angular/http": "2.0.0-rc.2",
"@angular/platform-browser": "2.0.0-rc.2",
"@angular/platform-browser-dynamic": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.2",
"angular2-in-memory-web-api": "0.0.12",
"body-parser": "1.15.2",
"bootstrap": "3.3.6",
"es6-shim": "0.35.1",
"fancybox": "3.0.0",
"jquery": "3.0.0",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.31",
"zone.js": "0.6.12"
devDependencies:
"del": "2.2.1",
"gulp": "3.9.1",
"gulp-typescript": "2.13.6",
"merge": "1.2.0",
"typescript": "1.8.10",
"typings": "1.3.1"
As you'll have understood from my repointing of VS to my own nodejs installation, the fix proposed by Luigie does not resolve the issue for me.
Looking forward to any resolution which you can provide for this matter.
Thanks
-Geoff.
I've tried to workaround this problem by using script wrapping npm and appending --no-optional
to npm install
and grepping UNMET OPTIONAL DEPENDENCY
message from npm ls
, but it seems that VS is traversing the dependency tree without using npm
and these warnings don't matter. So far the only workaround I've found is to open node_modules/chokidar/package.json
after npm install
(or any other package with missing optional dependency) and remove the optional package from dependencies
and optionalDependencies
.
I can sleep relatively well now, knowing VS is not yelling at me that I'm missing something.
Whenever I start my visual studio dot net project it again starts loading the package files due to which slowness occurs while loading the project. Is there is any work around ?
Any update on this issue please? Npm download the packages however still showing not installed as mentioned above
To echo @Kukkimonsuta, I created a .npmrc
in my project root with the following contents:
optional = "false"
loglevel = "error"
This didn't fix anything. The only solution was to remove any reference to fsevents
from node_modules/chokidar/package.json
. I'm using VS 2015 Update 3 with .NET Core 1.0.1 Tooling Preview 2.
I have fixed the issue like this:
Installed the latest version of npm: npm install -g npm@next
Added C:\Users
@lokap adding C:\Users\AppData\Roaming\npm
to PATH
doesn't fix it.
Any fix for this still seems to be an issue
PM> node -v
v7.5.0
PM> npm -v
4.1.2
PM>
Got the same problem.
Yep I too get have the same issue; very annoying! I guess one could write a script to always uninstall the fsevents package.
You can globally set optional to false when installing packages through NPM. "npm set optional=false". This eliminated the warning from the "Bower/npm" output in visual studio but I still get dependencies - not installed. If you search for "not installed" in the solution explorer, it will display "fsevents - not installed" for "chokidar". Still is starting to piss me off!
In no way should we have to resort to tampering with npm, node, or messing with the individual packages.
I feel this is a missing feature in package.json.
Upgrade to Visual Studio 2017. no problem on that end now! 👍
My problem was one of the packages that stopped all other packages from loading, the best way to see if all your packages that work is to start the command line interface "CMD" and navigate to your project -> Type:
npm install
and you will see if all your packets go through the installation without problems.
The package I had problems with the
Webpack "Webpack": "^ 1:12:14"
I had to uninstall it with Package Installer tool. just right click and uninstall package.
The NodeJS dependencies error disapeard immediately after. Reinstall your package by running:
npm install packagename
I am having this issue with the latest version of Visual Studio 2017 (15.5.1).
Node: 8.9.1
NPM: 5.5.1
Noty is installed in node_modules.
Does anyone know what steps visual studio takes to determine whether or not a package is installed. There's obviously something about Noty that is causing this?
I will raise a Noty issue if I can figure out what it's not displaying correctly, but I think it's a studio problem. The package is installed.
@jimmymain Have you tried turning it off and on again? I've just created empty mvc project in VS 15.5.1 and it works fine.
I can also confirm that missing optional dependencies no longer cause this behavior, so the issue can be probably closed. @sayedihashimi
mmmh odd. I tried a few things... then I erased all the code, fetched clean from TFS, and rebuilt from scratch.
It's working now.
Most helpful comment
Confirming that the problem is present in the official release.