Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't npm install in Ubuntu 20 #183

Open
Smityz opened this issue Oct 18, 2021 · 2 comments
Open

Can't npm install in Ubuntu 20 #183

Smityz opened this issue Oct 18, 2021 · 2 comments

Comments

@Smityz
Copy link
Contributor

Smityz commented Oct 18, 2021

Important:Please file the issue follow the template, or we won't help you to solve the problem.

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:
rm -rf package-lock.json
rm -rf node_modules
npm install
ts-node src/main.ts
  1. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

  • What is your wechaty version?
    Answer: v0.4

  • What is your node version? (run node --version)
    Answer: v10.19.0

  • What os are you using
    Answer: Ubuntu 20.04

2. Describe the bug

npm install

> wechaty@0.38.4 postinstall /home/smilencer/Code/osschat/node_modules/wechaty
> opencollective-postinstall

Thank you for using wechaty!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/wechaty/donate


> osschat@0.4.0 postinstall /home/smilencer/Code/osschat
> sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts

sed: can't read node_modules/@octokit/types/src/generated/Endpoints.ts: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! osschat@0.4.0 postinstall: `sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the osschat@0.4.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/smilencer/.npm/_logs/2021-10-18T03_52_07_944Z-debug.log

cat /home/smilencer/.npm/_logs/2021-10-18T03_52_07_944Z-debug.log

...
29002 silly linkStuff osschat@0.4.0 has /home/smilencer/Code as its parent node_modules
29003 silly install osschat@0.4.0
29004 info lifecycle osschat@0.4.0~install: osschat@0.4.0
29005 silly postinstall osschat@0.4.0
29006 info lifecycle osschat@0.4.0~postinstall: osschat@0.4.0
29007 verbose lifecycle osschat@0.4.0~postinstall: unsafe-perm in lifecycle true
29008 verbose lifecycle osschat@0.4.0~postinstall: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/smilencer/Code/osschat/node_modules/.bin:/home/smilencer/env/clang3.9.1/bin:/home/smilencer/env/admin-cli:/usr/lib/jvm/java-8-openjdk-amd64//bin:/home/smilencer/Code/GOPATH/bin:/home/smilencer/env/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
29009 verbose lifecycle osschat@0.4.0~postinstall: CWD: /home/smilencer/Code/osschat
29010 silly lifecycle osschat@0.4.0~postinstall: Args: [ '-c',
29010 silly lifecycle   'sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts' ]
29011 silly lifecycle osschat@0.4.0~postinstall: Returned: code: 2  signal: null
29012 info lifecycle osschat@0.4.0~postinstall: Failed to exec postinstall script
29013 verbose stack Error: osschat@0.4.0 postinstall: `sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts`
29013 verbose stack Exit status 2
29013 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
29013 verbose stack     at EventEmitter.emit (events.js:198:13)
29013 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
29013 verbose stack     at ChildProcess.emit (events.js:198:13)
29013 verbose stack     at maybeClose (internal/child_process.js:982:16)
29013 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
29014 verbose pkgid osschat@0.4.0
29015 verbose cwd /home/smilencer/Code/osschat
29016 verbose Linux 5.11.0-37-generic
29017 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
29018 verbose node v10.19.0
29019 verbose npm  v6.14.4
29020 error code ELIFECYCLE
29021 error errno 2
29022 error osschat@0.4.0 postinstall: `sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts`
29022 error Exit status 2
29023 error Failed at the osschat@0.4.0 postinstall script.
29023 error This is probably not a problem with npm. There is likely additional logging output above.
29024 verbose exit [ 2, true ]

3. To Reproduce

This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognized.

Steps to reproduce the behavior:

  1. run '...'
  2. ...
  3. ...

4. Expected behavior

Give a clear and concise description of what you expected to happen.

5. Actual behavior

If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.

6. Full Output Logs

Set env WECHATY_LOG=silly in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)

We need full log instead of log screenshot or log fragments!

Show Logs
$ WECHATY_LOG=silly ts-node src/main.ts

Question: Paste your FULL(DO NOT ONLY PROVIDE FRAGMENTS) log messages
Answer:

7. Additional context

Add any other context about the problem here.

[bug]

@huan
Copy link
Collaborator

huan commented Oct 18, 2021

sed -i 4d node_modules/@octokit/types/src/generated/Endpoints.ts

It seems our latest code does not contain this code.

Could you please pull the latest code from the main branch, then try with Node.js 16 again?

@Smityz
Copy link
Contributor Author

Smityz commented Oct 18, 2021

smilencer@mi osschat (pegasus-sub) $ node --version
v16.11.1
smilencer@mi osschat (pegasus-sub) $ npm install

up to date, audited 1585 packages in 2s

123 packages are looking for funding
  run `npm fund` for details

31 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
smilencer@mi osschat (pegasus-sub) $ npm audit
# npm audit report

ansi-regex  >2.1.1 <5.0.1
Severity: moderate
 Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix --force`
Will install wechaty@0.29.9, which is a breaking change
node_modules/cliui/node_modules/ansi-regex
node_modules/inquirer-command-prompt/node_modules/ansi-regex
node_modules/inquirer-command-prompt/node_modules/string-width/node_modules/ansi-regex
node_modules/qrcode/node_modules/ansi-regex
node_modules/tap/node_modules/log-update/node_modules/ansi-regex
node_modules/tap/node_modules/string-length/node_modules/ansi-regex
  strip-ansi  4.0.0 - 5.2.0
  Depends on vulnerable versions of ansi-regex
  node_modules/cliui/node_modules/strip-ansi
  node_modules/inquirer-command-prompt/node_modules/string-width/node_modules/strip-ansi
  node_modules/inquirer-command-prompt/node_modules/strip-ansi
  node_modules/qrcode/node_modules/strip-ansi
  node_modules/tap/node_modules/log-update/node_modules/strip-ansi
  node_modules/tap/node_modules/string-length/node_modules/strip-ansi
    cliui  4.0.0 - 5.0.0
    Depends on vulnerable versions of strip-ansi
    Depends on vulnerable versions of wrap-ansi
    node_modules/cliui
    node_modules/qrcode/node_modules/cliui
      jackspeak  >=0.1.0
      Depends on vulnerable versions of cliui
      node_modules/jackspeak
        tap  >=13.0.0-rc.0
        Depends on vulnerable versions of ink
        Depends on vulnerable versions of jackspeak
        node_modules/tap
          tstest  >=0.5.9
          Depends on vulnerable versions of tap
          node_modules/tstest
            @chatie/tsconfig  >=0.20.5
            Depends on vulnerable versions of tstest
            node_modules/@chatie/tsconfig
      yargs  10.1.0 - 15.0.0
      Depends on vulnerable versions of cliui
      Depends on vulnerable versions of string-width
      node_modules/qrcode/node_modules/yargs
        qrcode  >=1.3.4
        Depends on vulnerable versions of yargs
        node_modules/qrcode
          file-box  >=0.10.6
          Depends on vulnerable versions of qrcode
          node_modules/file-box
            wechaty-puppet  >=0.17.24
            Depends on vulnerable versions of file-box
            node_modules/wechaty-puppet
              wechaty  >=0.29.11
              Depends on vulnerable versions of open-graph
              Depends on vulnerable versions of wechaty-puppet
              node_modules/wechaty
                ha-wechaty  <=0.1.10 || >=0.7.2
                Depends on vulnerable versions of wechaty
                node_modules/ha-wechaty
                wechaty-plugin-contrib  <=0.4.10 || 0.15.12 - 0.19.2
                Depends on vulnerable versions of wechaty
                node_modules/wechaty-plugin-contrib
              wechaty-puppet-padlocal  >=0.1.1
              Depends on vulnerable versions of wechaty-puppet
              node_modules/wechaty-puppet-padlocal
    inquirer  3.2.0 - 7.0.4
    Depends on vulnerable versions of string-width
    Depends on vulnerable versions of strip-ansi
    node_modules/inquirer-command-prompt/node_modules/inquirer
      inquirer-command-prompt  0.0.7 - 0.0.32
      Depends on vulnerable versions of inquirer
      node_modules/inquirer-command-prompt
        @chatopera/sdk  >=2.2.1
        Depends on vulnerable versions of inquirer-command-prompt
        node_modules/@chatopera/sdk
          wechaty-chatopera  *
          Depends on vulnerable versions of @chatopera/sdk
          node_modules/wechaty-chatopera
    string-length  2.0.0 - 3.1.0
    Depends on vulnerable versions of strip-ansi
    node_modules/tap/node_modules/string-length
      ink  0.3.1 - 3.0.8
      Depends on vulnerable versions of log-update
      Depends on vulnerable versions of string-length
      node_modules/tap/node_modules/ink
      treport  *
      Depends on vulnerable versions of string-length
      node_modules/tap/node_modules/treport
    string-width  2.1.0 - 4.1.0
    Depends on vulnerable versions of strip-ansi
    node_modules/cliui/node_modules/string-width
    node_modules/inquirer-command-prompt/node_modules/string-width
    node_modules/qrcode/node_modules/string-width
    node_modules/tap/node_modules/log-update/node_modules/string-width
      wrap-ansi  3.0.0 - 6.1.0
      Depends on vulnerable versions of string-width
      Depends on vulnerable versions of strip-ansi
      node_modules/qrcode/node_modules/wrap-ansi
      node_modules/tap/node_modules/log-update/node_modules/wrap-ansi
        log-update  2.1.0 - 3.4.0
        Depends on vulnerable versions of wrap-ansi
        node_modules/tap/node_modules/log-update

hbs  *
Severity: moderate
Insertion of Sensitive Information into Externally-Accessible File or Directory and Exposure of Sensitive Information to an Unauthorized Actor in hbs - https://github.com/advisories/GHSA-7f5c-rpf4-86p8
fix available via `npm audit fix --force`
Will install probot@3.0.3, which is a breaking change
node_modules/hbs
  probot  >=4.0.0
  Depends on vulnerable versions of hbs
  node_modules/probot

nth-check  <2.0.1
Severity: moderate
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix --force`
Will install wechaty@0.29.9, which is a breaking change
node_modules/nth-check
  css-select  <=3.1.0
  Depends on vulnerable versions of nth-check
  node_modules/css-select
    cheerio  0.19.0 - 1.0.0-rc.3
    Depends on vulnerable versions of css-select
    node_modules/cheerio
      open-graph  >=0.2.2
      Depends on vulnerable versions of cheerio
      node_modules/open-graph
        wechaty  >=0.29.11
        Depends on vulnerable versions of open-graph
        Depends on vulnerable versions of wechaty-puppet
        node_modules/wechaty
          ha-wechaty  <=0.1.10 || >=0.7.2
          Depends on vulnerable versions of wechaty
          node_modules/ha-wechaty
          wechaty-plugin-contrib  <=0.4.10 || 0.15.12 - 0.19.2
          Depends on vulnerable versions of wechaty
          node_modules/wechaty-plugin-contrib

31 moderate severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants