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

Error: Module not found: Error: Can't resolve './immer.cjs.production.min.js' in '/home/ubuntu/my-project/node_modules/immer/dist' #8413

Closed
bigyanshr opened this issue Oct 20, 2020 · 2 comments · Fixed by #8420 · May be fixed by LalaIAm/trade-base#1 or LalaIAm/trade-base#4

Comments

@bigyanshr
Copy link

bigyanshr commented Oct 20, 2020

Describe the bug

I get the following error while creating a new project from the terminal.
Error: Module not found: Error: Can't resolve './immer.cjs.production.min.js' in '/home/ubuntu/my-project/node_modules/immer/dist'

Steps to reproduce the behavior

Run the command yarn create strapi-app my-project --quickstart

Expected behavior

It should create and start a new strapi application without any errors.

System

Node.js version: v12.19.0
NPM version: 6.14.8
Yarn: 1.22.5
Strapi version: 3.2.4
Database: default
Operating system: Ubuntu 18.04.5 LTS (WSL 2 on Windows 10 Home edition)

Additional context

Terminal Log

ubuntu@LAPTOP-DS327SLM:~$ yarn create strapi-app my-project --quickstart
yarn create v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
                                                                                                        success Installed "create-strapi-app@3.2.4" with binaries:
      - create-strapi-app
[#############################################################################################] 93/93Creating a new Strapi application at /home/ubuntu/my-project.

Creating a quickstart project.
Creating files.
Dependencies installed successfully.

Your application was created at /home/ubuntu/my-project.

Available commands in your project:

  yarn develop
  Start Strapi in watch mode.

  yarn start
  Start Strapi without watch mode.

  yarn build
  Build Strapi admin panel.

  yarn strapi
  Display all available commands.

You can start by doing:

  cd /home/ubuntu/my-project
  yarn develop


> my-project@0.1.0 build /home/ubuntu/my-project
> strapi build "--no-optimization"

Building your admin UI with development configuration ...

● Webpack █████████████████████████ building (58%) 407/473 modules 66 active
 node_modules/core-js/modules/es6.typed.float64-array.js

Error: Module not found: Error: Can't resolve './immer.cjs.production.min.js' in '/home/ubuntu/my-project/node_modules/immer/dist'
    at /home/ubuntu/my-project/node_modules/strapi-admin/index.js:70:23
    at finalCallback (/home/ubuntu/my-project/node_modules/webpack/lib/Compiler.js:257:39)
    at onCompiled (/home/ubuntu/my-project/node_modules/webpack/lib/Compiler.js:265:20)
    at /home/ubuntu/my-project/node_modules/webpack/lib/Compiler.js:670:21
    at eval (eval at create (/home/ubuntu/my-project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:26:1)
    at /home/ubuntu/my-project/node_modules/webpack/lib/Compilation.js:1173:13
    at /home/ubuntu/my-project/node_modules/webpack/lib/Compilation.js:1096:25
    at /home/ubuntu/my-project/node_modules/webpack/lib/Compilation.js:1017:13
    at /home/ubuntu/my-project/node_modules/neo-async/async.js:2830:7
    at /home/ubuntu/my-project/node_modules/neo-async/async.js:2830:7
    at done (/home/ubuntu/my-project/node_modules/neo-async/async.js:2863:11)
    at /home/ubuntu/my-project/node_modules/neo-async/async.js:2818:7
    at /home/ubuntu/my-project/node_modules/webpack/lib/Compilation.js:1017:13
    at /home/ubuntu/my-project/node_modules/neo-async/async.js:2830:7
    at /home/ubuntu/my-project/node_modules/neo-async/async.js:2830:7
    at done (/home/ubuntu/my-project/node_modules/neo-async/async.js:2863:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-project@0.1.0 build: `strapi build "--no-optimization"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-project@0.1.0 build 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/ubuntu/.npm/_logs/2020-10-20T22_56_30_416Z-debug.log
error Command failed.
Exit code: 1
Command: /home/ubuntu/.yarn/bin/create-strapi-app
Arguments: my-project --quickstart
Directory: /home/ubuntu
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Log File

ubuntu@LAPTOP-DS327SLM:~$ cat /home/ubuntu/.npm/_logs/2020-10-20T22_56_30_416Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/ubuntu/.nvm/versions/node/v12.19.0/bin/node',
1 verbose cli   '/home/ubuntu/.nvm/versions/node/v12.19.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   '--',
1 verbose cli   '--no-optimization'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v12.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-project@0.1.0~prebuild: my-project@0.1.0
6 info lifecycle my-project@0.1.0~build: my-project@0.1.0
7 verbose lifecycle my-project@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-project@0.1.0~build: PATH: /home/ubuntu/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ubuntu/my-project/node_modules/.bin:/home/ubuntu/my-project/node_modules/.bin:/home/ubuntu/node_modules/.bin:/home/node_modules/.bin:/node_modules/.bin:/home/ubuntu/.nvm/versions/node/v12.19.0/bin:/tmp/yarn--1603234500445-0.5768108717818985:/home/ubuntu/.config/yarn/global/node_modules/.bin:/home/ubuntu/.config/yarn/link/node_modules/.bin:/home/ubuntu/.yarn/bin:/home/ubuntu/.nvm/versions/node/v12.19.0/libexec/lib/node_modules/npm/bin/node-gyp-bin:/home/ubuntu/.nvm/versions/node/v12.19.0/lib/node_modules/npm/bin/node-gyp-bin:/home/ubuntu/.nvm/versions/node/v12.19.0/bin/node_modules/npm/bin/node-gyp-bin:/home/ubuntu/.nvm/versions/node/v12.19.0/bin:/home/ubuntu/.cargo/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2020.824.0_x64__79rhkp1fndgsc:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/Program Files/nodejs/:/mnt/c/acquia/php7_3_x64:/mnt/c/ProgramData/ComposerSetup/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/acquia/drush_10:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/DDEV:/mnt/c/Users/Nisha/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Nisha/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/Nisha/AppData/Roaming/npm:/mnt/c/Users/Nisha/AppData/Roaming/Composer/vendor/bin:/snap/bin
9 verbose lifecycle my-project@0.1.0~build: CWD: /home/ubuntu/my-project
10 silly lifecycle my-project@0.1.0~build: Args: [ '-c', 'strapi build "--no-optimization"' ]
11 silly lifecycle my-project@0.1.0~build: Returned: code: 1  signal: null
12 info lifecycle my-project@0.1.0~build: Failed to exec build script
13 verbose stack Error: my-project@0.1.0 build: `strapi build "--no-optimization"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/ubuntu/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/ubuntu/.nvm/versions/node/v12.19.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid my-project@0.1.0
15 verbose cwd /home/ubuntu/my-project
16 verbose Linux 4.19.128-microsoft-standard
17 verbose argv "/home/ubuntu/.nvm/versions/node/v12.19.0/bin/node" "/home/ubuntu/.nvm/versions/node/v12.19.0/bin/npm" "run" "build" "--" "--no-optimization"
18 verbose node v12.19.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error my-project@0.1.0 build: `strapi build "--no-optimization"`
22 error Exit status 1
23 error Failed at the my-project@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
@andrewrjohn
Copy link

I am running into this as well when trying to run strapi build from within a Docker container using the strapi/strapi image.

@ancoiscailletfr
Copy link

the missing dist file has been fixed 😃, just need to upgrade,
take look on immerjs/immer#685

derrickmehaffy added a commit that referenced this issue Oct 21, 2020
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
alexandrebodin added a commit that referenced this issue Oct 22, 2020
pascalvaccaro pushed a commit to pascalvaccaro/strapi that referenced this issue Oct 29, 2020
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
petersg83 pushed a commit that referenced this issue Nov 13, 2020
Signed-off-by: Derrick Mehaffy <derrickmehaffy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment