lusaxweb/vuesax-next

Failed for "npm install vuesax@next"

Taliro opened this issue · 3 comments

Hi,

I try install this framework, but after command "npm install vuesax@next" i have an error :

npm ERR! code 1
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/postinstall.js                                       
npm ERR! node:internal/modules/cjs/loader:936                                                                           
npm ERR!   throw err;                                                                                                   
npm ERR!   ^                                                                                                            
npm ERR!                                                                                                               
 npm ERR! Error: Cannot find module 'chalk'                                                                              
npm ERR! Require stack:                                                                                                 
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)                              
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:778:27)                                         
npm ERR!     at Module.require (node:internal/modules/cjs/loader:1005:19)                                              
 npm ERR!     at require (node:internal/modules/cjs/helpers:102:18)                                                      
npm ERR!     at Object.<anonymous> (D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax\scripts\postinstall.js:2:15)                                                                                                                   npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1103:14)                                              
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)                                
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)                                                   
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)                                        
 npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {                    
npm ERR!   code: 'MODULE_NOT_FOUND',                                                                                    
npm ERR!   requireStack: [      

after command "npm install chalk" i retry and :

npm ERR! code 1
npm ERR! path D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/postinstall.js
npm ERR! D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax\scripts\postinstall.js:2
npm ERR! const chalk = require('chalk')
npm ERR!               ^
npm ERR!
npm ERR! Error [ERR_REQUIRE_ESM]: require() of ES Module D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\chalk\source\index.js from D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax\scripts\postinstall.js not supported.
npm ERR! Instead change the require of index.js in D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax\scripts\postinstall.js to a dynamic import() which is available in all CommonJS modules.
npm ERR!     at Object.<anonymous> (D:\Projets\Lab\dragAndDrop\vue-drag-drop\node_modules\vuesax\scripts\postinstall.js:2:15) {
npm ERR!   code: 'ERR_REQUIRE_ESM'
npm ERR! }

npm ERR! A complete log of this run can be found in:

i try add "type:"module" into my package.json but nothink

I got same error, see https://www.npmjs.com/package/chalk "Chalk 5 is ESM. If you want to use Chalk with TypeScript or a build tool, you will probably want to use Chalk 4 for now."
npm i chalk@4 then npm i vuesax@next solved my problem

Thanks for this tips !

I got the same error too. will vuesax update to support esm to import chalk soon?