shazron opened a new issue, #113:
URL: https://github.com/apache/openwhisk-wskdebug/issues/113

   ## Investigation
   
   Even though `cpu-features` is an optional dependency, I'm not sure why it is 
installed. Doesn't seem to affect anything AFAIK. The error is because 
`python@2` is no longer included in macOS Monterey 12.3 or greater: 
https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes#Python
   
   I'm using nodejs-14 with npm@6, so it is not because of the automatic 
install of optional dependencies of npm@7.
   
   ## Workaround
   
   Install python@2 on macOS: 
https://www.python.org/downloads/release/python-2713/
   
   ## Fix
   
   Dependency tree:
   ```
   $ npm ls cpu-features
   └─┬ @openwhisk/[email protected]
     └─┬ [email protected]
       └─┬ [email protected]
         └─┬ [email protected]
           └── UNMET OPTIONAL DEPENDENCY [email protected]
   ```
   
   Make sure this optional dependency is not installed, somehow. This will 
require a fix in the dependencies of wskdebug, not wskdebug itself.
   
   ## Error Log and Repro Steps
   <details>
    <summary>Click to see...</summary>
   ```
   $ mkdir npm-init-test
   $ cd npm-init-test
   $ npm init -y
   Wrote to /Users/shaz/Desktop/tmp/npm-init-test/package.json:
   
   {
     "name": "npm-init-test",
     "version": "1.0.0",
     "description": "",
     "main": "index.js",
     "scripts": {
       "test": "echo \"Error: no test specified\" && exit 1"
     },
     "keywords": [],
     "author": "",
     "license": "ISC"
   }
   
   $ npm install @openwhisk/wskdebug
   
   > [email protected] install 
/Users/shaz/Desktop/tmp/npm-init-test/node_modules/cpu-features
   > node buildcheck.js > buildcheck.gypi && node-gyp rebuild
   
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_aarch64_linux_or_android.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_arm_linux_or_android.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_mips_linux_or_android.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_ppc_linux.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_freebsd.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_linux_or_android.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_macos.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/impl_x86_windows.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/filesystem.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/stack_line_reader.o
     CC(target) 
Release/obj.target/cpu_features/deps/cpu_features/src/string_view.o
     LIBTOOL-STATIC Release/cpu_features.a
   env: python: No such file or directory
   make: *** [Release/cpu_features.a] Error 127
   gyp ERR! build error
   gyp ERR! stack Error: `make` failed with exit code: 2
   gyp ERR! stack     at ChildProcess.onExit 
(/Users/shaz/.nvm/versions/node/v14.19.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
   gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
   gyp ERR! stack     at Process.ChildProcess._handle.onexit 
(internal/child_process.js:285:12)
   gyp ERR! System Darwin 21.4.0
   gyp ERR! command "/Users/shaz/.nvm/versions/node/v14.19.2/bin/node" 
"/Users/shaz/.nvm/versions/node/v14.19.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js"
 "rebuild"
   gyp ERR! cwd /Users/shaz/Desktop/tmp/npm-init-test/node_modules/cpu-features
   gyp ERR! node -v v14.19.2
   gyp ERR! node-gyp -v v5.1.0
   gyp ERR! not ok
   
   > [email protected] install /Users/shaz/Desktop/tmp/npm-init-test/node_modules/ssh2
   > node install.js
   
     CXX(target) Release/obj.target/sshcrypto/src/binding.o
     SOLINK_MODULE(target) Release/sshcrypto.node
   Succeeded in building optional crypto binding
   npm notice created a lockfile as package-lock.json. You should commit this 
file.
   npm WARN [email protected] No description
   npm WARN [email protected] No repository field.
   npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] 
(node_modules/cpu-features):
   npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: 
`node buildcheck.js > buildcheck.gypi && node-gyp rebuild`
   npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
   
   + @openwhisk/[email protected]
   added 124 packages from 102 contributors and audited 126 packages in 27.081s
   
   15 packages are looking for funding
     run `npm fund` for details
   
   found 0 vulnerabilities
   ```
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to