I've cloned a nextjs example repo locally, and tried to run it using npm run dev, but it's not finding "next" as a command?
sh: next: command not found
I googled it, suggestions seemed to be that I should run
npm i -g create-next-app
Which I did, but still get the same error?
How can I resolve this?
For my particular case, I forgot to run npm install in the repo I'd just cloned :D
Once I did that, running npm run dev worked fine and found next.
But I suspect in general if you're trying to run a cloned repo based on npm, and get a similar response, you may simply have forgotten to install your dependencies, like I did.
Note that this can also happen for an existing project if you have some script that removes the node_modules folder as part of a cleanup process (which I do as well)
All of my next apps are getting stuck at event - compiled successfully when I try and run them using yarn dev. Everything from existing apps I've used before to brand new apps I literally make just for trying this fresh.
I've tried deleting node_modules and yarn.lock, running yarn again, then running yarn dev. No dice. I also updated node js to latest and tried a few iterations of the above, including some with a 'yarn build` step to see if that did anything. No luck.
Assuming it's some kind of machine config that got messed up, but I can't for the life of me figure out what it is. Ideas?
replace with it in package.json
“dev”: “next dev -p 1234",
When I compile the application I get an error equal to this:
Could not build Objective-C module 'Firebase'
This error appear in import Firebase of my file swift.
There is only one way to solve this issue.
Quit Xcode.
Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder
Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
Build (⌘ + B) worked for me.
I am using Swift 4 and Xcode 9. All I have to do is selecting FirebaseCore Scheme.
On Xcode:
Product->Scheme->FirebaseCore.
If you don't have FirebaseCore go to Manage Schemes and select it. Then try again.
This may fix your problem:
Quit the Xcode. (Don't just close the Xcode window, right click and Quit it explicitly).
Go to ~/Library/Developer/Xcode/DerivedData and delete the project folder. (Simply delete all the folders).
Clean and Build the project.
If still error exist:
Do steps 1 and 2 and follow this steps:
Change scheme to Firebase and Build (Command + B).
Change back to your app scheme and Run again.
I opened the project with .xcodeproj and I installed Firebase with cocoapods. I got the same error. But I just close the project and open it with .xcworkspace.
The alert has gone. Firebase was the first library on my project. So I kept using .xcodeproj file.
Install FireBase properly via CocoaPods. Try the following steps
Step 1 - Close Xcode
Step 2 - Clear your derived data. You can find your derived data in here
~/Library/Developer/Xcode/DerivedData
Step 3 - Open your .xcworkspace
Step 4 - Clean your project (⌘+Shift+K)
Step 5 - Build your project (⌘+B)
Make sure your are opened .xcworkspace file
'pod deintegrate' and then 'pod install' worked for me.
I recently had this problem when using Xcode 12. I found that removing the Valid Architectures build setting (VALID_ARCHS) fixed it.
From the Xcode 12 release notes:
The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)
I am using Swift 4 and Xcode 9.4. This helped solve the same issue for me.
I selected the following frameworks in XCode -> Manage Schemes besides my target project
In Xcode:
Product-> Scheme-> FirebaseCore
Product -> Scheme -> nanopb
Product -> Scheme -> GoogleToolBoxforMac
Tried the above suggestions, but they didn't work for me. What worked for me was to build to Generic iOS Device first and then run it on my physical device iPhone6.
I still couldn't run it on a simulator, however. What worked here was to change Build Active Architecture Only - Debug to NO, in the Pod Project Build Settings.
Hope this helps someone.
This worked for me:
Close Xcode
pod deintegrate
delete xcworkspace
pod install
In project Navigator > project name > Configurations
Set all to none
Clean
Build
I had disabled Find Implicit Dependencies for faster build process under Edit Scheme... > Build.
Enabling it back resolved the issue.
It happened to me because I installed the Firebase CocoaPods but I didn't reopen it through the <projectName>.xcworkspace file.
So what I did to work was:
I quit Xcode
opened it by clicking the <projectName>.xcworkspace file of the project
then I could use "import Firebase" on my project.
For me the issue was simple. I have a new m1 mac and it has trouble loading cocoa pods sometimes. Simply:
Click your pods project(blue pods)->
Click all & build settings ->
Excluded architectures ->
add "arm64" to both debug and release ->
set any SDK on left side ->
do this on your main project folder too ->
build it your good to go
Can you please try to take a look at my answer here
TL;DR make sure you are running cocoapods version 1.4.0 minimum. It fixes static framework imports.
You can do this by running sudo gem install cocoapods on your terminal and verify your version by typing pod --version
I tried this (quitting Xcode, deleting all temp files, reinstalling pods, etc.) and it didn't work. What did work was just building my project (command + b) after pod install. Whatever works!
Make sure you are working with the workspace file created in the same directory as the pod file.
It worked for me, when I opened the white workspace instead of the blue one. You press on the file on your desktop and then press the white file.
Image of what the file looks like:
I had a same issue with a Flutter project.
You should exclude arm64 for simulator architecture both from project and every pod target
Exclude arm64 from the project
Add this code to Pofile
post_install do |installer|
installer.pods_project.targets.each do |target|
# exclude arm64 for simulator architecture the pod target
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
This happened to me today, I just couldn't figure out why, because when I closed the file that night, everything was perfect. I opened my file using the recent projects menu and got this issue. Then I decided to check something, Xcode opened the wrong file. Instead of opening the workspace file with the pods, it opened the Xcode project.
Once I opened the workspace it was error free and all the pods were behaving. Im sure you guys are all more experienced than me, but I just wanted to throw that in there.
just restart your xcode and run your project.
Nothing here worked for me, but then I figured out something that did work.
When I clicked on my project in Project Navigator in Xcode, and then selected Info I looked at the Configurations section and saw that there was only a Release configuration and no Debug configuration for my app.
In order to get Firebase to work, I went to Pods within the Project Navigator, and under the Configurations section I deleted the Debug configuration. Now it builds fine. Hopefully this will help someone else.
After 2 days of searching and trying every single step proposed in this post, eventually i could solve the problem. None of the above approaches solved my problem but this one:
There is a package of Firebase frameworks available to download from this link:
https://firebase.google.com/download/ios?authuser=0
There is a Firebase.h header file in this package. I added this header file to my project resources.
Finally i added a line of code at the top of this file:
' #import "Firebase.h" '
Simply and Easily the error is gone!
For and Solution was as simple as I didn't open the project from the .xcworkspace after I did pod install :D and I got the same error you got.
I mistakenly opened it from the old .xcodeproj file.
that was it for me, LOL
None of above solutions worked for me. I found that the problem was I have three targets in Cocoapods file. And only my main one target has Firebase added. So that when I want to import Firebase to a file that is used in other targets, Xcode gives error and says Module 'Firebase' not found. This is my pods project file. One solution for me is adding Firebase pod to all targets. Or another solution is removing the file from other targets.
def common_pods
pod 'XXX'
end
target 'myMainProject' do
common_pods()
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'Firebase/RemoteConfig'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
end
target 'myExtention1' do
common_pods()
end
target 'myextension2' do
common_pods()
end
Just go to Pod target and set arm64 in Excluded Architectures
This solution worked for me.
Delete project's temp files located at
~/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
When you build, make sure you are at the root directory in the project navigator.
This worked for me:
rm -rf project.xcworkspace
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf Podfile.lock
pod install
/!\ Open project.xcworkspace instead of your old file
I had the exact same issue
You could be reinstalling pods with your Xcode open
Or your pods file won't allow and overwrite
With your workspace open, delete the "Pods" folder.
Quit X-Code
Open terminal in "Utilities"
You'll find this in "Applications"
Using cd ... go to your project folder
reinstall pods using "pod install".
That should fix it.
Backstory
I've been trying to set up a project in Visual Studio, which uses GulpJS to compile Sass. I was told that VS should automatically recognize the package.json inside a project and run npm install, but I had to do that manually through a command line. Even then, when I opened Task Runner Explorer, it says that there are (No tasks found). My coworker and I looked up solutions that worked for other people, many of which reported having success after restarting VS, clearing some cached data, or reinstalling the node modules; however none of those worked for me. Here are some solutions I've attempted:
Visual Studio 2015 RC Gulp task runner not detecting tasks (All Answers)
https://stackoverflow.com/a/37437209/6425704
Basically the entire first page of Google for "visual studio gulp no tasks found"
The Problem
After some digging, I came across the Package Manager Console and decided that maybe I can run gulp through that instead of opening a separate CMD window. However, when I did, I got the following:
[11:27:43] Local gulp not found in C:\
[11:27:43] Try running: npm install gulp
My immediate thought was that I might need to reinstall the dependencies, so I ran npm install and got this output:
npm : npm WARN enoent ENOENT: no such file or directory, open 'C:\package.json'
At line:1 char:1
+ npm install
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (npm WARN enoent...:\package.json':String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm
WARN
!invalid#1 No license field.
This is when I noticed that it is looking for C:\package.json instead of the one inside my Project directory. However, when I ran ls, it clearly shows that it's inside the Solution root, at C:\Dev\solution-name. I tried navigating to the specific Project, using cd Presentation\Nop.Web, but I still get the result of it looking in the C:\ root. Can anyone explain why this is happening and how I can fix it?
I finally figured it out (one more day, and I would've offered a bounty for this question), and it's not a problem with VS. Back when I first started using this specific computer and was still using Windows' default Command Prompt, I didn't like it starting in %USERPROFILE% by default. So I looked for a way change the default and stumbled upon a registry "hack" which essentially runs cd C:/ on cmd.exe startup. However, it turns out that this causes other command line tools, including Powershell and VS's Package Manager to run that command.
If anyone else is experiencing this issue (which, due to the nature of this situation, I doubt anyone has), you can try following these steps:
Open up Registry Editor. I did it by using the Windows Run tool (Win + R) and typing regedit.
Navigate to HKEY_CURRENT_USER > SOFTWARE > Microsoft > Command Processor.
Remove AutoRun (or change its value to something that won't interfere with your workflow).
More info here.
Original Registry Tutorial (Note that if I had scrolled down a bit more, I might have avoided this situation.)
I am following the installation guidelines as described on mean.js.org Everything seemed to install fine. I have all prereqs installed. I ran npm install after cloning the github repo and then tried to run grunt and I didnt get any errors however It seems to just be stalling on the command line. Last message on the command line is the "debugger is running on port 5858" and then it just sits there.
After some time the message [nodemon] watching 51,839 files - this might cause high cpu usage. To reduce use "--watch" comes up. I am on windows 10 and have all the latest versions of node,npm,grunt and mean.js. I am running the command line as admin.
Mean.js should be running on localhost:3000 but it is not.
This is intended.
There is an application invoked by the grunt command and running in background, watching your files for changes. In default configuration: nodemon and grunt-watch.
This will execute specific tasks based on the files you edited, such as linting JS files or compiling LESS files.
The cmd will probably show something when you edit files in the projects directory.