vgteam / sequenceTubeMap

displays multiple genomic sequences in the form of a tube map
MIT License
179 stars 24 forks source link

Fail to build #210

Open Johnsonzcode opened 1 year ago

Johnsonzcode commented 1 year ago

Dear @adamnovak, I came cross an error when I build sequenceTubeMap

(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ yarn install
yarn install v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 0.49s.
(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ yarn build
yarn run v1.22.19
$ react-scripts build
Creating an optimized production build...
Failed to compile.

[eslint] Failed to load plugin 'import' declared in 'package.json » eslint-config-react-app': Cannot find module 'typescript/package.json'
Require stack:
- /storage-01/poultrylab1/zhaoqiangsen/software/sequenceTubeMap/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js
- /storage-01/poultrylab1/zhaoqiangsen/software/sequenceTubeMap/node_modules/eslint-plugin-import/lib/index.js
- /storage-01/poultrylab1/zhaoqiangsen/software/sequenceTubeMap/node_modules/@eslint/eslintrc/dist/eslintrc.cjs

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ l
total 1.7M
drwxrwxr-x   2 poultrylab1 poultrylab1   53 Jan 12 10:48 build
drwxrwxr-x 925 poultrylab1 poultrylab1  28K Jan 12 10:40 node_modules
-rw-rw-r--   1 poultrylab1 poultrylab1 474K Jan 12 10:38 yarn.lock
drwxrwxr-x   2 poultrylab1 poultrylab1   32 Jan 12 10:13 uploads
drwxrwxr-x   4 poultrylab1 poultrylab1  295 Jan 12 10:13 src
drwxrwxr-x   2 poultrylab1 poultrylab1  121 Jan 12 10:13 scripts
drwxrwxr-x   2 poultrylab1 poultrylab1   75 Jan 12 10:13 public
-rw-rw-r--   1 poultrylab1 poultrylab1 2.0K Jan 12 10:13 package.json
-rw-rw-r--   1 poultrylab1 poultrylab1 1.1M Jan 12 10:13 package-lock.json
drwxrwxr-x   2 poultrylab1 poultrylab1  104 Jan 12 10:13 images
drwxrwxr-x   4 poultrylab1 poultrylab1 4.0K Jan 12 10:13 exampleData
-rw-rw-r--   1 poultrylab1 poultrylab1 1015 Jan 12 10:13 deploy.md
-rw-rw-r--   1 poultrylab1 poultrylab1 1.1K Jan 12 10:13 LICENSE.txt
-rw-rw-r--   1 poultrylab1 poultrylab1  11K Jan 12 10:13 README.md

Could you help me ? Thanks in advance!

Best Johnson

adamnovak commented 1 year ago

I just tried checking out the current commit and ran:

npm install
npm run build

using NPM 6.14.15 and Node v14.18.2, and the build worked.

If I do npm ls I do see a bunch of complaints about unmet peer dependencies on typescript, but those are peer dependencies of things a couple levels down in the dependency tree, and not peer dependencies of any modules we actually directly depend on, so they shouldn't need to be met by us, as far as I can tell. We don't actually have any Typescript code that gets imported, just a little pseudo-typescript for documentation.

After that I tried:

yarn install
yarn build

and that also worked, with Yarn 1.22.0.

Then I tried building from a clean checkout:

git clone https://github.com/vgteam/sequenceTubeMap.git
cd sequenceTubeMap
yarn install
yarn build

And that also worked.

So then I installed Yarn 1.22.19 exactly, and built from a clean checkout again. That also worked.

Then I wondered if you were using a different Node, so I installed Node 18 (since Node 17 is not compatible with Yarn 1.22.19) and Yarn 1.22.19 and did it again. That also worked, and even managed to produce some eslint warnings.

What does your npm ls say @Johnsonzcode? Did you maybe also install typescript or otherwise do something that I'm not doing?

Johnsonzcode commented 1 year ago

I did't do anything else, just install yarn from mamba. This is npm ls information

(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ npm ls
sequence-tube-maps@0.1.0 /storage-01/poultrylab1/zhaoqiangsen/software/sequenceTubeMap
├── @emotion/react@11.10.5
├── @emotion/styled@11.10.5
├── @fortawesome/fontawesome-svg-core@6.2.1
├── @fortawesome/free-solid-svg-icons@6.2.1
├── @fortawesome/react-fontawesome@0.2.0
├── @material-ui/core@4.12.4
├── @mui/material@5.11.4
├── @testing-library/dom@8.19.1
├── @testing-library/jest-dom@5.16.5
├── @testing-library/react@12.1.5
├── @testing-library/user-event@13.5.0
├── body-parser@1.20.1
├── bootstrap@5.2.2
├── compression@1.7.4
├── concurrently@7.6.0
├── d3-selection-multi@1.0.1
├── d3@5.16.0
├── dotenv@16.0.3
├── express@4.18.2
├── fs-extra@10.1.0
├── gh-pages@4.0.0
├── multer@1.4.4
├── path-is-inside@1.0.2
├── polyfill-object.fromentries@1.0.1
├── prettier@2.8.2
├── prop-types@15.8.1
├── qs@6.11.0
├── react-dom@17.0.2
├── react-fast-compare@3.2.0
├── react-scripts@5.0.1
├── react-select-event@5.5.1
├── react-select@5.7.0
├── react@17.0.2
├── reactstrap@9.1.5
├── uuid@9.0.0
├── webpack-dev-server@4.11.1
├── webpack@5.75.0
└── websocket@1.0.34
adamnovak commented 1 year ago

Hmmm. That's nowhere near enough modules, and none of them have any of their dependencies installed. I don't think yarn installed the project's dependencies properly. My npm ls looks like this and goes on for a few pages:

[anovak@octagon sequenceTubeMap]$ npm ls
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
sequence-tube-maps@0.1.0 /home/anovak/workspace/sequenceTubeMap
├─┬ @emotion/react@11.10.5
│ ├─┬ @babel/runtime@7.20.1
│ │ └── regenerator-runtime@0.13.10
│ ├─┬ @emotion/babel-plugin@11.10.5
│ │ ├─┬ @babel/helper-module-imports@7.18.6
│ │ │ └── @babel/types@7.20.2 deduped
│ │ ├─┬ @babel/plugin-syntax-jsx@7.18.6
│ │ │ └── @babel/helper-plugin-utils@7.20.2
│ │ ├── @babel/runtime@7.20.1 deduped
│ │ ├── @emotion/hash@0.9.0
│ │ ├── @emotion/memoize@0.8.0
│ │ ├── @emotion/serialize@1.1.1 deduped
│ │ ├─┬ babel-plugin-macros@3.1.0
│ │ │ ├── @babel/runtime@7.20.1 deduped
│ │ │ ├── cosmiconfig@7.0.1 deduped
│ │ │ └── resolve@1.22.0 deduped
│ │ ├─┬ convert-source-map@1.8.0
│ │ │ └── safe-buffer@5.1.2 deduped
│ │ ├── escape-string-regexp@4.0.0
│ │ ├── find-root@1.1.0
│ │ ├── source-map@0.5.7
│ │ └── stylis@4.1.3
...

What npm --version do you have? Maybe you have a new one that elides nested dependencies from the list somehow?

I'm not sure how mamba works; I get my yarn through npm and my npm and node through NVM. Is there like a set of commands I can run in a Docker container to set up mamba the way you have it set up so I can try and replicate your problem?

To try and get it working, I would recommend:

  1. Check your node --version. If it is weirdly old maybe upgrade it?
  2. Try npm ci (to use the package-lock.json versions of everything) and npm run build from a clean checkout, instead of using yarn.
  3. Try npm install typescript and try the build again, because it's complaining about a missing typescript and you can just give it one like that.
Johnsonzcode commented 1 year ago

1.mamba is like conda, as a kind of packages management tools. I just create an environment named yarn, and install yarn by mamba install yarn=1.22.19 -c anaconda/cloud/conda-forge. Then I follow documentation

git clone https://github.com/vgteam/sequenceTubeMap.git
cd sequenceTubeMap
yarn install
yarn build

After this I came across the error.

  1. My node version
    
    (yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ npm --version
    8.19.2
3. Try npm ci (to use the package-lock.json versions of everything) and npm run build from a clean checkout, instead of using yarn.

(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ npm ci npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin. npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated multer@1.4.4: Multer 1.x is affected by CVE-2022-24434. This is fixed in v1.4.4-lts.1 which drops support for versions of Node.js before 6. Please upgrade to at least Node.js 6 and version 1.4.4-lts.1 of Multer. If you need support for older versions of Node.js, we are open to accepting patches that would fix the CVE on the main 1.x release line, whilst maintaining compatibility with Node.js 0.10. npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN deprecated core-js@3.21.1: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

added 1417 packages, and audited 1418 packages in 47s

188 packages are looking for funding run npm fund for details

21 vulnerabilities (20 high, 1 critical)

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. (yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ npm run build

sequence-tube-maps@0.1.0 build react-scripts build

Creating an optimized production build... Compiled with warnings.

src/components/HeaderForm.js Line 345:13: The array literal notation [] is preferable no-array-constructor

Search for the keywords to learn more about each warning. To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

227.05 kB build/static/js/main.4377647b.js 28.62 kB build/static/css/main.b072c09f.css 2.57 kB build/static/js/599.32ebe36f.chunk.js

The project was built assuming it is hosted at /. You can control this with the homepage field in your package.json.

The build folder is ready to be deployed. You may serve it with a static server:

yarn global add serve serve -s build

Find out more about deployment here:

https://cra.link/deployment

It seems it works.

Because

(yarn) [poultrylab1@pbsnode01 sequenceTubeMap]$ yarn serve yarn run v1.22.19 $ node ./src/server.js TubeMapServer listening on http://[::]:3000