Phosphor icon indicating copy to clipboard operation
Phosphor copied to clipboard

npm build failed

Open waffel opened this issue 7 years ago • 8 comments

The npm build failed with following error:

`At D:\Dev\projects\git\Phosphor\Phosphor.build.ps1:121 char:1

  • task Build BuildModule, BuildClient

Build FAILED. 4 tasks, 1 errors, 0 warnings 00:00:23.4323402 npm.cmd : typings WARN deprecated 2016-9-14: "registry:dt/core-js#0.0.0+20160317120654" is deprecated (updated, replaced or removed) At D:\Dev\projects\git\Phosphor\Phosphor.build.ps1:112 char:12

  • exec { & npm install }
    
  •        ~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (typings WARN de...ced or removed):String) [], RemoteException
    • FullyQualifiedErrorId : NativeCommandError `

I have installed the latest node.js LTS package v6.10.3.

waffel avatar May 07 '17 10:05 waffel

Ahhh crap, npm's warning writing strikes again. This trips up Invoke-Build and makes it think the npm install command failed. I had to change the log level to avoid this problem for the PowerShell extension:

    $logLevelParam = if ($env:AppVeyor) { "--loglevel=error" } else { "" }
    exec { & npm install $logLevelParam }

Might need to set the log level correctly in Phosphor's build script too.

daviwil avatar May 07 '17 12:05 daviwil

@waffel have you tried npm install -g npm --silent . I got the same error on Appveyor build during Invoke-Build. README file made a bit confused, as 4th item was referring a manual installation [which could be delegated to AppVeyor install step, is npm installation part of setup or Invoke-Build? ]. Assuming, we want npm installation is part of manual step [and thus AppVeyor install process], I got npm install -g npm --silent working - on my Mac 10.12.4 and on AppVeyor build -

ebrucucen avatar May 10 '17 12:05 ebrucucen

Hey Ebru! Looks like you're updating npm with that command? I think you're right, I remember having to update npm because it was a bug that caused this behavior. I'm using this line in my appveyor.yml on another project to make sure a more recent version of Node.js and npm are installed:

https://github.com/PowerShell/vscode-powershell/blob/develop/appveyor.yml#L17

daviwil avatar May 10 '17 13:05 daviwil

Then again, @waffel is seeing this on node 6.10 so maybe I'm remembering things incorrectly :)

daviwil avatar May 10 '17 13:05 daviwil

Ok, here is state of the play.

  1. At AppVeyor.yml, I parametrised the version of the node to be installed, so that we can run matrix builds. i.e. $env:nodejs_version has for 4 values:
  • "6.9.2" as referred in VSCode
  • "6.10.2" as ReadMe suggests
  • "6.10.3" as @waffel has
  • "7", just checking for fun...
  1. Also added tests to Appveyor.yml to verify the version of npm and node installed.
test_script: 
  - node --version
  - npm --version

a. On my master branch, I kept the origin Invoke-Build tasks as is. Results:

1: Node v6.9.2 2: Node v6.10.3 3: Node v6.10.4 4:Node v7
v6.9.2 v6.10.3 v6.10.4 v7

b. On my Appveyornpm branch, I removed the BuildClient task from Phosphor.build.ps1, put the npm and typescript install to AppVeyor

  - npm install -g npm --silent
  - npm install -g typescript

The results for

1: Node v6.9.2 2: Node v6.10.3 3: Node v6.10.4 4:Node v7
v6.9.2 v6.10.3 v6.10.4 v7

I believe the version of the typescript is not working, and installing typescript does solve the build issue [if not creating another bug...]

ebrucucen avatar May 11 '17 15:05 ebrucucen

@ebrucucen thanks for the in-depth analysis! Since we don't really rely on Node.js for anything other tha building the TypeScript code, we won't need a build matrix for that. We just need whatever works for getting the code to build on the CI server. In theory we should not need to install TypeScript globally to get everything to work, it gets installed locally in the project as a development dependency.

Would certainly love a PR once you've got things finished up!

daviwil avatar May 11 '17 18:05 daviwil

Agreed, four versions were for my curiosity, as multiple versions mentioned on the same bug... were not to submit a PR. And I do also agree, we should not install anything globally, had to dig more to get the project dependency working...

ebrucucen avatar May 11 '17 21:05 ebrucucen

Cool! Definitely understand wanting to investigate it, your findings were certainly helpful :)

daviwil avatar May 11 '17 21:05 daviwil