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

Installing via npm fails #7

Open
eugenesimakin opened this issue Apr 12, 2020 · 1 comment
Open

Installing via npm fails #7

eugenesimakin opened this issue Apr 12, 2020 · 1 comment

Comments

@eugenesimakin
Copy link

Hi folks,
I have a problem installing this plugin.
Environment:

  • Windows 10 Home
  • npm 6.14.4
  • nodejs v13.11.0
  • preact-cli 2.2.1

So, here is what I did (STR):

  • install preact-cli npm install -g preact-cli
  • create a project from the default template preact create default my-project
  • change directory to my-project cd my-project
  • ensure that build is working npm run build
  • install the preact-cli-plugin-flow npm install preact-cli-plugin-flow --save-dev
  • create the preact.config.js file and put there
const preactCliFlow = require('preact-cli-plugin-flow');
export default function (config) {
	preactCliFlow(config);
}

Then I tried to execute npm run build and it failed. The console output:

> default@0.0.0 build C:\my-project
> preact build

× ERROR C:\my-project\node_modules\preact-cli-plugin-flow\src\index.js:1
Error: Cannot find module 'babel-plugin-transform-flow-strip-types'
Require stack:
- C:\my-project\node_modules\preact-cli-plugin-flow\src\index.js
- C:\my-project\preact.config.js
- C:\my-project\node_modules\preact-cli\lib\lib\webpack\transform-config.js
- C:\my-project\node_modules\preact-cli\lib\lib\webpack\run-webpack.js
- C:\my-project\node_modules\preact-cli\lib\commands\build.js
- C:\my-project\node_modules\preact-cli\lib\commands\index.js
- C:\my-project\node_modules\preact-cli\lib\index.js
    at Object.<anonymous> (C:\my-project\node_modules\preact-cli-plugin-flow\src\index.js:1)
    at Generator.next (<anonymous>)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! default@0.0.0 build: `preact build`
npm ERR! Exit status 1

So after all these steps, I tried removing the node_modules directory and then installing the dependencies again. The installation succeeded and I tried to run the npm run build again. Now, I'm getting another error:

> default@0.0.0 build C:\my-project
> preact build

× ERROR Error: TypeError: Cannot read property 'filter' of undefined
    at preactCliFlow (C:\my-project\node_modules\preact-cli-plugin-flow\src\index.js:8:33)              
    at default (C:\my-project\preact.config.js:4:2)                                                     
    at module.exports (C:\my-project\node_modules\preact-cli\lib\lib\webpack\transform-config.js:117:10)
    at async prodBuild (C:\my-project\node_modules\preact-cli\lib\lib\webpack\run-webpack.js:83:2)      
    at async module.exports (C:\my-project\node_modules\preact-cli\lib\commands\build.js:37:14)         
    at module.exports (C:\my-project\node_modules\preact-cli\lib\lib\webpack\transform-config.js:128:10)
    at async prodBuild (C:\my-project\node_modules\preact-cli\lib\lib\webpack\run-webpack.js:83:2)      
    at async module.exports (C:\my-project\node_modules\preact-cli\lib\commands\build.js:37:14)         
npm ERR! code ELIFECYCLE                                            
npm ERR! errno 1                                                    
npm ERR! default@0.0.0 build: `preact build`                        
npm ERR! Exit status 1                                              
npm ERR!                                                            
npm ERR! Failed at the default@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Looks like the versions incompatibility issue.

Here is the repo to reproduce it:
https://github.com/eugenesimakin/preact-cli-plugin-flow-issue-reproduce

@eugenesimakin
Copy link
Author

Update on the version of preact-cli.
Despite the fact that I installed the 2.2.1 version of CLI the default template has another version 3.0.0-rc.6.
Here is the reference to the template's package.json https://github.com/preactjs-templates/default/blob/6fc0ee89e33ea080ce7570843763dd3a31571967/template/package.json#L27

Thanks, any advice would be appreciated.

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

1 participant