Running Angular5 on NodeJS16

Viewed 47

I am trying to run Angular5 project on NodeJs16, Windows10 machine.(Reason - I have been told to do so, as same app is working on MacOS with NodeJs16.)

Initially, this project was working fine on NodeJs12, Windows10 machine So as part of rebuilding I have uninstall Node12 and reinstalled Node16.

Then I cleared cache under Angular project (deleting node_modules folder) and run this cmd - npm cache clean --force. Then I tried to - npm install

However I am getting below error stack -

12148 verbose stack Error: command failed
12148 verbose stack     at ChildProcess.<anonymous> (C:\Users\a-skhedekar1\AppData\Roaming\npm\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:63:27)
12148 verbose stack     at ChildProcess.emit (node:events:527:28)
12148 verbose stack     at maybeClose (node:internal/child_process:1092:16)
12148 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
12149 verbose pkgid node-sass@4.14.1
12150 verbose cwd C:\Siddhesh\Application_Repository\bosn\bosn-app
12151 verbose Windows_NT 10.0.17763
12152 verbose node v16.15.1
12153 verbose npm  v8.19.1
12154 error code 1
12155 error path C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass
12156 error command failed
12157 error command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
12158 error Building: C:\Program Files\nodejs\node.exe C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
12158 error Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
12158 error Build started 09/13/2022 5:22:35 PM.
12158 error Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.sln" on node 1 (default targets).
12158 error ValidateSolutionConfiguration:
12158 error   Building solution configuration "Release|x64".
12158 error Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.sln" (1) is building "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) on node 1 (default targets).
12158 error Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) is building "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\src\libsass.vcxproj" (3) on node 1 (default targets).
12158 error C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
12158 error Done Building Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\src\libsass.vcxproj" (default targets) -- FAILED.
12158 error Done Building Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.vcxproj.metaproj" (default targets) -- FAILED.
12158 error Done Building Project "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.sln" (default targets) -- FAILED.
12158 error
12158 error Build FAILED.
12158 error
12158 error "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.sln" (default target) (1) ->
12158 error "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->
12158 error "C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\src\libsass.vcxproj" (default target) (3) ->
12158 error   C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
12158 error
12158 error     0 Warning(s)
12158 error     1 Error(s)
12158 error
12158 error Time Elapsed 00:00:00.07
12159 error gyp info it worked if it ends with ok
12159 error gyp verb cli [
12159 error gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
12159 error gyp verb cli   'C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-gyp\\bin\\node-gyp.js',
12159 error gyp verb cli   'rebuild',
12159 error gyp verb cli   '--verbose',
12159 error gyp verb cli   '--libsass_ext=',
12159 error gyp verb cli   '--libsass_cflags=',
12159 error gyp verb cli   '--libsass_ldflags=',
12159 error gyp verb cli   '--libsass_library='
12159 error gyp verb cli ]
12159 error gyp info using node-gyp@3.8.0
12159 error gyp info using node@16.15.1 | win32 | x64
12159 error gyp verb command rebuild []
12159 error gyp verb command clean []
12159 error gyp verb clean removing "build" directory
12159 error gyp verb command configure []
12159 error gyp verb check python checking for Python executable "C:\Python27\python.exe" in the PATH
12159 error gyp verb `which` succeeded C:\Python27\python.exe C:\Python27\python.exe
12159 error gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.17
12159 error gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
12159 error gyp verb get node dir no --target version specified, falling back to host node version: 16.15.1
12159 error gyp verb command install [ '16.15.1' ]
12159 error gyp verb install input version string "16.15.1"
12159 error gyp verb install installing version: 16.15.1
12159 error gyp verb install --ensure was passed, so won't reinstall if already installed
12159 error gyp verb install version is already installed, need to check "installVersion"
12159 error gyp verb got "installVersion" 9
12159 error gyp verb needs "installVersion" 9
12159 error gyp verb install version is good
12159 error gyp verb get node dir target node version installed: 16.15.1
12159 error gyp verb build dir attempting to create "build" dir: C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build
12159 error gyp verb build dir "build" dir needed to be created? C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build
12159 error gyp verb build/config.gypi creating config file
12159 error gyp verb build/config.gypi writing out config file: C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\build\config.gypi
12159 error (node:3448) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
12159 error (Use `node --trace-deprecation ...` to show where the warning was created)
12159 error gyp verb config.gypi checking for gypi file: C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\config.gypi
12159 error gyp verb common.gypi checking for gypi file: C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass\common.gypi
12159 error gyp verb gyp gyp format was not specified; forcing "msvs"
12159 error gyp info spawn C:\Python27\python.exe
12159 error gyp info spawn args [
12159 error gyp info spawn args   'C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-gyp\\gyp\\gyp_main.py',
12159 error gyp info spawn args   'binding.gyp',
12159 error gyp info spawn args   '-f',
12159 error gyp info spawn args   'msvs',
12159 error gyp info spawn args   '-G',
12159 error gyp info spawn args   'msvs_version=2015',
12159 error gyp info spawn args   '-I',
12159 error gyp info spawn args   'C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-sass\\build\\config.gypi',
12159 error gyp info spawn args   '-I',
12159 error gyp info spawn args   'C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-gyp\\addon.gypi',
12159 error gyp info spawn args   '-I',
12159 error gyp info spawn args   'C:\\Users\\a-skhedekar1\\.node-gyp\\16.15.1\\include\\node\\common.gypi',
12159 error gyp info spawn args   '-Dlibrary=shared_library',
12159 error gyp info spawn args   '-Dvisibility=default',
12159 error gyp info spawn args   '-Dnode_root_dir=C:\\Users\\a-skhedekar1\\.node-gyp\\16.15.1',
12159 error gyp info spawn args   '-Dnode_gyp_dir=C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-gyp',
12159 error gyp info spawn args   '-Dnode_lib_file=C:\\Users\\a-skhedekar1\\.node-gyp\\16.15.1\\<(target_arch)\\node.lib',
12159 error gyp info spawn args   '-Dmodule_root_dir=C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-sass',
12159 error gyp info spawn args   '-Dnode_engine=v8',
12159 error gyp info spawn args   '--depth=.',
12159 error gyp info spawn args   '--no-parallel',
12159 error gyp info spawn args   '--generator-output',
12159 error gyp info spawn args   'C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-sass\\build',
12159 error gyp info spawn args   '-Goutput_dir=.'
12159 error gyp info spawn args ]
12159 error gyp verb command build []
12159 error gyp verb build type Release
12159 error gyp verb architecture x64
12159 error gyp verb node dev dir C:\Users\a-skhedekar1\.node-gyp\16.15.1
12159 error gyp verb found first Solution file build/binding.sln
12159 error gyp verb using MSBuild: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
12159 error gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
12159 error gyp info spawn args [
12159 error gyp info spawn args   'build/binding.sln',
12159 error gyp info spawn args   '/nologo',
12159 error gyp info spawn args   '/p:Configuration=Release;Platform=x64'
12159 error gyp info spawn args ]
12159 error gyp ERR! build error 
12159 error gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe` failed with exit code: 1
12159 error gyp ERR! stack     at ChildProcess.onExit (C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-gyp\lib\build.js:262:23)
12159 error gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
12159 error gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
12159 error gyp ERR! System Windows_NT 10.0.17763
12159 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Siddhesh\\Application_Repository\\bosn\\bosn-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
12159 error gyp ERR! cwd C:\Siddhesh\Application_Repository\bosn\bosn-app\node_modules\node-sass
12159 error gyp ERR! node -v v16.15.1
12159 error gyp ERR! node-gyp -v v3.8.0
12159 error gyp ERR! not ok 
12159 error Build failed with error code: 1
12160 verbose exit 1
12161 timing npm Completed in 320712ms
12162 verbose unfinished npm timer reify 1663053472484
12163 verbose unfinished npm timer reify:build 1663053744500
12164 verbose unfinished npm timer build 1663053744525
12165 verbose unfinished npm timer build:deps 1663053744526
12166 verbose unfinished npm timer build:run:postinstall 1663053751327
12167 verbose unfinished npm timer build:run:postinstall:node_modules/node-sass 1663053751795
12168 verbose code 1

Line 12159 complains about msbuild, For this I searched on google and did below -

  1. npm install -g node-gyp, npm install --global --production windows-build-tools@4.0.0
  2. Updated my environment PATH variable under UserProfile C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe But still error persists.

Line 12148, complains about node-saas, for this

  1. deleted node_modules folder under my UserProfile Path - C:\Users\a-skhedekar1\AppData\Roaming\npm. But still same error. So further I uninstalled node-sass and installed sass as per suggestion

But unable to get rid-off off same error stack.

I have also deleted package-lock.json (which suggests node-sass ^4.14.1) and retried above steps. But still error persists. Not sure from where is node-sass-4.14.1 getting picked. There is one reference in package.json - "@types/node": "9.6.7".

I am looking for assistance for next steps. Do let me know your opinion.

0 Answers
Related