I setup a new project using Yarn and NextJS on my Windows machine today. Upon start-up, I get an error that the casing is "invalid" for my project directory. Specifically, I am seeing the following errors:
Invalid casing detected for project dir, received c:\super-amazing-project actual path C:\super-amazing-project
There are multiple modules with names that only differ in casing.
The kicker is that in the error message the two paths are identical except for the drive letter.
How do I fix this?
Versions
Yarn version 1.22.17
NextJS version 12.1.5
Console output
c:\super-amazing-project>yarn dev
yarn run v1.22.17
$ next dev
warn - Invalid casing detected for project dir, received c:\super-amazing-project actual path C:\super-amazing-project, see more info here https://nextjs.org/docs/messages/invalid-project-dir-casing
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
./node_modules/react/cjs/react.development.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* C:\super-amazing-project\node_modules\react\cjs\react.development.js
Used by 2 module(s), i. e.
C:\super-amazing-project\node_modules\react\index.js
* c:\super-amazing-project\node_modules\react\cjs\react.development.js
Used by 2 module(s), i. e.
c:\super-amazing-project\node_modules\react\index.js
package.json
{
"name": "super-amazing-project",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"#chakra-ui/react": "^1.8.8",
"#emotion/react": "11",
"#emotion/styled": "11",
"framer-motion": "6",
"next": "12.1.5",
"react": "18.0.0",
"react-dom": "18.0.0",
"react-icons": "^4.3.1"
},
"devDependencies": {
"#types/node": "17.0.25",
"#types/react": "18.0.6",
"#types/react-dom": "18.0.2",
"eslint": "8.13.0",
"eslint-config-next": "12.1.5",
"typescript": "4.6.3"
}
}
You probably changed the case of the drive letter on Windows in the command terminal by using a command like cd c:\super-amazing-project and then setup a project with a lowercase Windows drive letter. This causes strange issues like the ones you're experiencing.
Solution 1. Change the case of the drive letter and try yarn dev again
You can change the case of the drive letter on Windows using the cd command like this
C:\super-amazing-project>cd c:\
c:\>cd super-amazing-project
c:\super-amazing-project> yarn dev
Solution 2. Setup your project again using the default uppercase drive letter
Installing with the non-default lowercase drive letter on Windows may have placed your new project in a bad state. If this project is fresh, it may be easier to just run npx create-next-app again and copy your project files.
Having issues installing all packages for cakephp 4.0 via Composer. Running a fresh wamp server install on Windows with PHP 7.4.0
Here is composer output. Using the command found in the cakephp docs.
www/> composer create-project --prefer-dist cakephp/app:^4.0 myapp
Installing cakephp/app (4.0.0)
- Installing cakephp/app (4.0.0): Loading from cache
Created project in kollectit
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package cakephp/bake ^4.0 exists as cakephp/bake[0.1.0, 0.1.10, 1.0.0, 1.0.1, 1.0.10, 1.0.11, 1.0.12, 1.0.13, 1.0.14, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.10.0, 1.10.1, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.2.0, 1.2.1, 1.2.10, 1.2.11, 1.2.12, 1.2.13, 1.2.14, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.x-dev, 2.0.0, 2.0.1, 2.0.2, 2.0.3, dev-3.next, dev-dereuromark-patch-1, dev-fix-old-alias, dev-master, dev-twigview-5] but these are rejected by your constraint.
Problem 2
- Installation request for cakephp/migrations 3.0.0-beta1 -> satisfiable by cakephp/migrations[3.0.0-beta1].
- cakephp/migrations 3.0.0-beta1 requires robmorgan/phinx 0.11.x-dev -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
The base cakephp installation is there in the /myapp folder, but wondering on the errors and if they are needed (if so how to resolve? )
Here is the composer.json that is created:
{
"name": "cakephp/app",
"description": "CakePHP skeleton app",
"homepage": "https://cakephp.org",
"type": "project",
"license": "MIT",
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0",
"cakephp/migrations": "3.0.0-beta1",
"cakephp/plugin-installer": "^1.0",
"mobiledetect/mobiledetectlib": "2.*"
},
"require-dev": {
"cakephp/bake": "^4.0",
"cakephp/cakephp-codesniffer": "dev-next",
"cakephp/debug_kit": "^4.0",
"josegonzalez/dotenv": "3.*",
"phpunit/phpunit": "^8.0",
"psy/psysh": "#stable"
},
"suggest": {
"markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
"dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility."
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Test\\": "tests/",
"Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
}
},
"scripts": {
"post-install-cmd": "App\\Console\\Installer::postInstall",
"post-create-project-cmd": "App\\Console\\Installer::postInstall",
"post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump",
"check": [
"#test",
"#cs-check"
],
"cs-check": "phpcs --colors -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"cs-fix": "phpcbf --colors --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/",
"stan": "phpstan analyse src/",
"stan-setup": "cp composer.json composer.backup && composer require --dev phpstan/phpstan-shim:^0.11 && mv composer.backup composer.json",
"test": "phpunit --colors=always"
},
"prefer-stable": true,
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
Thanks!
You need to install the latest app template (4.0.2 currently), there have been some fixes around this.
The problem is that you are using ^ on the Windows command line, where the caret character is an escape character, ie it's not being passed to composer, which will only receive cakephp/app:4.0, which means that it will install 4.0.0.
Simple fix, enclose the package argument in double quotes:
composer create-project --prefer-dist "cakephp/app:^4.0" myapp
or do not specify a version constraint at all, which will automatically give you the latest stable version:
composer create-project --prefer-dist cakephp/app myapp
react-native start command stuck on Loading dependency graph, done. Running Metro Bundler on port 8081.
Windows 8 :
node version : 8.11.3
npm version : 6.3.0
react-native: 0.56.0
package.json
{
"name": "TestApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.4.1",
"react-native": "0.56.0"
},
"devDependencies": {
"babel-jest": "23.4.2",
"babel-preset-react-native": "5.0.2",
"jest": "23.5.0",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
It's supposed to get stuck there until a device successfully connects to it. The problem is probably that your device for some reason is unable to find your computer, in that case you should get an error message on the phone mentioning it can't connect to the development server. All those suggestions mentioned in that error message may help you solve the problem. Pay extra attention to the development server's host and port configuration. If you have configured the host and port a long time ago and it suddenly stopped to work, a likely cause could be that your computer has been assigned a new ip address, so maybe double check that you're using the correct IP address. Another problem may be that your computer isn't publicly visible on your network.
Try this.
Your device can't found localhost like Lenny Laughter said, and the solution to that is running adb -s <device name> reverse tcp:8081 tcp:8081.
This way, your device can see the port 8081 and connect to the Metro Bundler.
You need to start the app on your physical device or emulator.
Followed below steps:
I have created IAM user, where that user is attached to a Group and that Group has a policy set as AdministratorAccess.
I have configured awsmobile, using awsmobile configure, pasted creds from IAM user created above. Changed the region to us-east-2
While executing awsmobile init, I'm getting an error as below that contains us-east-1 as a region, but why.
backend awsmobile project creation error
{ NetworkingError: The header content contains invalid characters
at validateHeader (_http_outgoing.js:494:11)
at ClientRequest.setHeader (_http_outgoing.js:498:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
at Object.request (https.js:239:15)
at features.constructor.handleRequest (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\http\node.js:42:23)
at executeSend (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:304:29)
at Request.SEND (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\event_listeners.js:318:9)
at Request.callListeners (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:101:18)
at Request.emit (C:\Users\manus\AppData\Roaming\npm\node_modules\awsmobile-cli\node_modules\aws-sdk\lib\sequential_executor.js:77:10)
message: 'The header content contains invalid characters',
code: 'NetworkingError',
region: 'us-east-1',
hostname: 'mobile.us-east-1.amazonaws.com',
retryable: true,
time: 2018-04-28T15:26:56.753Z
Below is package.json file:
"dependencies": {
"amazon-cognito-identity-js": "^2.0.3",
"aws-amplify": "^0.3.3",
"aws-amplify-react": "^0.1.43",
"aws-sdk": "^2.228.1",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-scripts": "1.1.4"
},
Node.js version: 8.11.1
awsmobile version: 1.1.1
npm version: 6.0.0
yarn version: 1.6.0
OS: Windows 10 VSCode: 1.22.2
Github Issue
It's working fine now.
I disabled firewall and copied creds using chrome developer tool and it worked. Then I re-enabled the firewall and tried again and it still worked. I thought problem was that I was copying the creds from AWS console itself, but then I tried to create a new user and copied from AWS console instead of chrome developer tool, and it also worked i.e everything is working now.
I also tried to create a new project by following https://github.com/aws-samples/aws-mobile-react-sample#getstarted and it also went well.
So, I can't recreate it now. Not sure what was the issue.
I am having an issue when publishing my .Net Core 2.0 Angular SPA from Visual Studio 2017 Community. The site compiles and runs fine through the debugger.
When I try to publish (to ftp) I get the following error;
The command "node node_modules/webpack/bin/webpack.js --config webpack.config.vendor.js --env.prod" exited with code 1.
If I then run 'webpack --config ./project1/web' on the package manager console i get the error;
webpack : Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
At line:1 char:1
+ webpack --config ./project1/webpack.config.vendor.js
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Invalid configu...the API schema.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Any ideas on how to rectify this please?
I am running node 5.6.0 and the webpack in my package.json is;
"webpack": "3.10.0",
"webpack-hot-middleware": "2.21.0",
"webpack-merge": "4.1.1",