I have problem with my powershell script. I want to build one project which is based on node 10.17.0 and copy the result into other project which is based on node 8.11.4 and run the project.
cd $PathToWebLibs
Write-Host "..........Switching to node v10.17.0.........." -ForegroundColor Magenta
nvm use 10.17.0
Write-Host "..........Building WebLibs.........." -ForegroundColor Magenta
npm run build_lib
Write-Host "..........Copying files from ($PathToWebLibs\dist\rsp\core-ui) to ($PathToSFP\node_modules\@rsp) .........." -ForegroundColor Magenta
cp -Recurse -Force ($PathToWebLibs + "\dist\rsp\core-ui") ($PathToSFP + "\node_modules\@rsp")
cd $PathToSFP
Write-Host "..........Switching to node v8.11.4.........." -ForegroundColor Magenta
nvm use 8.11.4
Write-Host "..........Starting SFP.........." -ForegroundColor Magenta
npm run start
The problem is that when nvm changes version of node npm is not recognized. When I did it manually simply type in commands one by one it works.
I can just add that system environmental path is set correctly. I checked it.