NPM Install doesn't download packages

Lukas van Driel's Avatar

Lukas van Driel

30 Jul, 2018 02:17 PM


Since this morning, two of my npm install tasks don't install anything. There isn't even a node_modules folder created.
The things I've tried:

  • re-build an old commit from last week -> same issue, while last week it build perfectly
  • disabled cache with environment variables (see example below) -> same issue
  • used yarn instead of npm -> node_modules is created, but with just 1 file in it (.yarnconfig i recall it was)

Here are the main parts of my appveyor.yml:

version: 3.71.{build}
image: Visual Studio 2017
  NODE_ENV: production
  nodejs_version: "8.11.3"
configuration: Release
platform: Any CPU
skip_branch_with_pr: true
shallow_clone: true
clone_folder: c:\projects\MYPROJECT

install: - npm cache clean --force - npm i npm@latest -g - pw: set-version.ps1 - ps: Install-Product node $env:nodejs_version - cd C:\projects\MYPROJECT\src\MYPROJECT.CollectionApi && npm install && npm --no-git-tag-version version %APPVEYOR_BUILD_VERSION% - cd C:\projects\MYPROJECT\src\MYPROJECT.AuthApi && npm install && npm --no-git-tag-version version %APPVEYOR_BUILD_VERSION% - cd c:\projects\MYPROJECT\src\MYPROJECT.Cms\Static && npm install && npm list && dir && cd node_modules.bin && grunt build-from-vs - cd c:\projects\MYPROJECT\src\MYPROJECT.Web\Static && npm install && npm list && dir && cd node_modules.bin && grunt build-from-vs

before_build: - cmd: node -v - cmd: npm -v - cmd: cd c:\projects\MYPROJECT - cmd: nuget restore src\MYPROJECT.Web.sln -Verbosity quiet

build: project: src\MYPROJECT.Web.sln parallel: true verbosity: quiet publish_wap: true

The issue is in the last two install steps. When I add --verbose to the npm i command, i get this log:

npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
npm verb cli   'C:\\Users\\appveyor\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'install',
npm verb cli   '--verbose' ]
npm info using npm@6.2.0
npm info using [email blocked]
npm verb npm-session e1d317523e4c2a33
npm info lifecycle MYPROJECT-cms@~preinstall: MYPROJECT-cms@
npm timing stage:loadCurrentTree Completed in 13ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 223ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 277ms
npm timing stage:loadIdealTree Completed in 601ms
npm timing stage:generateActionsToTake Completed in 29ms
npm verb correctMkdir C:\Users\appveyor\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm timing audit compress Completed in 4ms
npm info audit Submitting payload of 11280bytes
npm verb lock using C:\Users\appveyor\AppData\Roaming\npm-cache\_locks\staging-66a60127419303ce.lock for c:\projects\MYPROJECT\src\MYPROJECT.Cms\Static\node_modules\.staging
npm verb unlock done using C:\Users\appveyor\AppData\Roaming\npm-cache\_locks\staging-66a60127419303ce.lock for c:\projects\MYPROJECT\src\MYPROJECT.Cms\Static\node_modules\.staging
npm timing stage:executeActions Completed in 310ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm info linkStuff MYPROJECT-cms@
npm info lifecycle MYPROJECT-cms@~install: MYPROJECT-cms@
npm info lifecycle MYPROJECT-cms@~postinstall: MYPROJECT-cms@
npm timing stage:runTopLevelLifecycles Completed in 1083ms
npm verb saving []
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN MYPROJECT-cms@ No description
npm WARN MYPROJECT-cms@ No repository field.
npm WARN MYPROJECT-cms@ No license field.
npm timing audit submit Completed in 1003ms
npm http fetch POST 200 798ms
npm timing audit body Completed in 1ms
audited 580 packages in 1.786s
found 32 vulnerabilities (10 low, 13 moderate, 9 high)
  run `npm audit fix` to fix them, or `npm audit` for details
npm verb exit [ 0, true ]
npm timing npm Completed in 2209ms
npm info ok 

MYPROJECT-cms@ c:\projects\MYPROJECT\src\MYPROJECT.Cms\Static
`-- (empty)

The last two lines are the result of npm list, there are no packages installed. However, the npm install resulted in audited 580 packages. I don't know where it gets these 580 packages from, because they're not in an node_modules folder.

The weirdest thing is that re-building a successful commit from last week, breaks this week.

Hope someone can help out!


  1. 1 Posted by Ilya Finkelshte... on 30 Jul, 2018 08:37 PM

    Ilya Finkelshteyn's Avatar

    Please send a links to successful (last week) and failed (today) builds of the same commit.

  2. 2 Posted by Lukas van Driel on 31 Jul, 2018 08:42 AM

    Lukas van Driel's Avatar

    Sorry I thought I had answered my own question yesterday, but I don't see my answer here.

    The issue was in my configuration. My project only had devDependencies, and I needed those installed. But a few months (!!) ago I added the NODE_ENV=production environment variable. Since then, the devDependencies weren't installed anymore, but I didn't see that because the node_modules folder was cached. Only now was the cache invalidated and did I notice that it was broken.

    So I fixed it by passing --only=production to the specific projects that needed a production build, and the other projects are installing both prod & dev dependencies.

    It took me quite a few hours to figure this out. Sorry I doubted you, appveyor! :)

  3. 3 Posted by Ilya Finkelshte... on 31 Jul, 2018 09:11 AM

    Ilya Finkelshteyn's Avatar

    Thanks a lot for the update, much appreciated!

  4. Ilya Finkelshteyn closed this discussion on 30 Sep, 2018 09:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac