00308001 Failed to Delete the File
Error Message
Failed to delete the file: XXX.
Symptom
File deletion failed.
Possible Causes
- The file does not exist.
- The user does not have the permission to delete the file.
- The file is locked by another process.
Solution
- Verify that the file exists at the specified path.
- Ensure that the current user has the permission to delete the file.
- Check if the file is locked by another process. If yes, wait until it is released and try again.
- Try manually deleting the file.
00308002 Failed to Run the Command During Hvigor Environment Initialization
Error Message
XXX execute failed.
Symptom
The command fails to be executed during Hvigor environment initialization.
Possible Causes
Root causes vary by scenario; troubleshoot based on the build logs printed to the console.
- Scenario 1: The build log contains "ERR_PNPM_FETCH_404", indicating that the package to be installed does not exist in the repository. The root cause can be either a typo in the package name or failure to publish the package to the remote NPM repository specified in configuration.
- Scenario 2: The build log contains "ERR_PNPM_NO_MATCHING_VERSION", indicating that the package of the specified version does not exist in the repository. The root cause may be that the package of the specified version has not been published to the remote NPM repository specified in configuration.
- Scenario 3: The build log contains "ERR_PNPM_META_FETCH_FAIL", indicating that the metadata of the package cannot be found, due to network failures or incorrect NPM repository URL configuration.
- Scenario 4: The build log contains "ERR_PNPM_NO_OFFLINE_META", indicating that the metadata of a dependency package cannot be found in the local cache in offline mode. This may be because related dependencies in the package are not fully packaged.
- Scenario 5: The build log contains "CERT_HAS_EXPIRED", indicating that the certificate of the target remote NPM repository server has expired.
- Scenario 6: The build log contains "ETIMEDOUT", indicating that the connection to the NPM repository timed out due to network failures or incorrect NPM repository URL configuration.
Solution
- Scenario 1
- Check whether the failed package exists in the NPM repository or contact the package provider to confirm the repository URL.
- Check whether the package name is misspelled.
- Scenario 2
- Run the following command on the console to query the version of the target package to be installed in the NPM repository:
pnpm view ${xxx} versions - Check whether the package name is misspelled.
- If the missing package is @ohos/hvigor-ohos-arkui-x-plugin, perform the following steps to find the matching plugin version:
- Create an ArkUI-X template project.
- Open the hvigor/hvigor-config.json5 file and find the version of @ohos/hvigor-ohos-arkui-x-plugin in dependencies.
- Replace the version of @ohos/hvigor-ohos-arkui-x-plugin in the faulty project with the version retrieved in the previous step.
- Scenario 3
- Check whether the NPM repository URL is correct and whether there are firewall or proxy restrictions to ensure accessibility of the configured repository URL.
- Contact the repository provider to check whether the repository URL is available, or use a new NPM repository URL.
- Scenario 6
- Check whether the NPM repository URL is correct and whether there are firewall or proxy restrictions to ensure accessibility of the configured repository URL.
- Contact the repository provider to check whether the repository URL is available, or use a new NPM repository URL.
00308003 Hvigor Entry File Not Found
Error Message
ENOENT: no such file XXX.
Symptom
The Hvigor entry file cannot be found.
Possible Causes
Some misoperations damage the integrity of Hvigor.
Solution
Delete the \.hvigor\project_caches\xxxxxxxx\workspace directory and try again.
00308004 Failed to Delete the build Directory
Error Message
Unable to delete XXX.
Symptom
The build directory fails to be deleted.
Possible Causes
One or more files in the directory are in use.
Solution
Close the files in use and try again.
00308005 Failed to Write the File
Error Message
Write file failed: XXX, at file: YYY.
Symptom
Failed to write the file.
Possible Causes
- The file does not exist.
- The user does not have the permission to write the file.
- The file is in use.
Solution
- Ensure that the file exists.
- Request the permission to write the file.
- Close the file in use and try again.
00308006 Encryption or Decryption Failure
Error Message
Encryption and decryption errors occur. The specific error message depends on the situation.
Symptom
Encryption or decryption errors occur.
Possible Causes
The encryption or decryption material is corrupted for unknown reasons.
Solution
Delete the meta directory from the .hvigor folder. By default, the .hvigor folder is located in the user directory:
- Windows: C:\Users\username\.hvigor
- macOS: /Users/username/.hvigor
- Linux:
- root user: /root/.hvigor
- Non-root user: /home/username/.hvigor
For details, see Customizing the .hvigor Directory Path.
00308007 File Operation Failed
Error Message
Failed to operate file as XXX.
Symptom
File operation failed.
Possible Causes
The current user does not have the permission to operate the file, or the specified file path is invalid.
Solution
- Grant the current user appropriate permissions for the file.
- Ensure the file path is correct and accessible.
00308008 Failed to Write the File
Error Message
Failed to write File: XXX.
Symptom
Failed to write the file.
Possible Causes
The file permission is incorrect, the path is incorrect, or the disk space is insufficient.
Solution
- Request the permission to write the file.
- Configure a correct and valid file path.
- Delete unnecessary files to ensure sufficient disk space.
00308009 File Write Failure Due to File Not Found
Error Message
Failed to write File: please check File Path:XXX.
Symptom
The file fails to be written because it cannot be found.
Possible Causes
The file path is incorrect, or the file does not exist.
Solution
Configure a correct and valid file path.
00308010 Failed to Execute the pnpm store prune Command
Error Message
Error: pnpm store prune execute failed.
Symptom
Failed to execute the pnpm store prune command.
Possible Causes
You do not have the permissions to modify or delete files when running the pnpm store prune command.
Solution
Ensure that you have sufficient permissions to access the pnpm cache directory in the user directory.
00308013 Failed to Delete the Directory
Error Message
Failed to delete the directory: XXX.
Symptom
Failed to delete the directory.
Possible Causes
- The user does not have the permission to delete the directory.
- One or more files in the directory are in use by another process.
Solution
- Request the permission to delete the directory.
- Close the files in use and try again.
00308014 Failed to Copy the File
Error Message
Failed to copy the file: XXX.
Symptom
Failed to copy the file.
Possible Causes
- The file to be copied does not exist.
- The user does not have the permission to read the file.
Solution
- Ensure that the file exists and request the permission to read the file.
- If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.
00308015 Failed to Copy the Folder
Error Message
Failed to copy the directory: XXX.
Symptom
Failed to copy the folder.
Possible Causes
- The folder to be copied does not exist.
- The user does not have the permission to read the folder.
Solution
- Ensure that the folder exists and request the permission to read the folder.
- If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.
00308017 Cache Material Error
Error Message
Cache material error. Please ensure that no cache materials have been added or modified in the meta/ac, ce, and fd directories. At file: XXX.
Symptom
A cache material error occurs due to added or modified cache materials in the meta/ac, meta/ce, or meta/fd directories.
Possible Causes
The cache materials are added or modified by mistake.
Solution
- Check the number of cache materials in the .hvigor/meta directory under Users/User name to confirm it is correct: there should be 1, 1, and 3 files or folders in the ac, ce, and fd directories, respectively. Ensure no additions or modifications have been made to the content of these directories.
- Delete the meta directory under .hvigor and recompile.
00308018 Unknown Error
Error Message
Unknown Error.
Symptom
Unknown error.
Possible Causes
- Error message containing "Remote sign har failed" indicates that the JDK version specified for HAR pipeline build is earlier than 21 when ohos.sign.har is set to true in the hvigor-config.json5 file.
- Other unknown causes.
Solution
- Upgrade the JDK version of the pipeline to 21.
- Analyze the detailed error logs in the .hvigor/outputs/build-logs directory under the project directory. If the error persists, submit a ticket online. Huawei will get back to you as soon as possible.
00308019 Failed to Find the Specified Package in the NPM Repository
Error Message
xxx install execute failed. More details:
ERR_PNPM_FETCH_404 GET https://xxx/yyy: - 404
This error happened while installing a direct dependency of xxx.
yyy is not in the npm registry, or you have no permission to fetch it.
No authorization header was set for the request.
Symptom
The target package cannot be found in the remote NPM repository specified in configuration.
Possible Causes
The package to be installed does not exist in the repository. The root cause can be either a typo in the package name or failure to publish the package to the remote NPM repository specified in configuration.
Solution
- Check whether the failed package exists in the NPM repository or contact the package provider to confirm the repository URL.
- Check whether the package name is misspelled.
00308020 Failed to Find the Package of the Specified Version in the NPM Repository
Error Message
xxx install execute failed. More details:
ERR_PNPM_NO_MATCHING_VERSION No matching version found for yyy@a.b.c while fetching it from https://xxx.
This error happened while installing a direct dependency of xxx.
The latest release of yyy is "x.y.z". Published at xxx.
If you need the full list of all published versions run "$ pnpm view yyy versions".
Symptom
The target package of the specified version cannot be found in the remote NPM repository specified in configuration.
Possible Causes
The package of the specified version does not exist in the repository. The root cause may be that the package of the specified version has not been published to the remote NPM repository specified in configuration.
Solution
- Run the following command on the console to query the version of the target package in the NPM repository:
pnpm view ${yyy} versions - Check whether the package name is misspelled.
- If the missing package is @ohos/hvigor-ohos-arkui-x-plugin, perform the following steps to find the matching plugin version:
- Create an ArkUI-X template project.
- Open the hvigor/hvigor-config.json5 file and find the version of @ohos/hvigor-ohos-arkui-x-plugin in dependencies.
- Replace the version of @ohos/hvigor-ohos-arkui-x-plugin in the faulty project with the version retrieved in the previous step.
00308021 Failed to Obtain the Package Metadata from the NPM Repository
Error Message
xxx install execute failed. More details:
WARN GET https://xxx/yyy error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://xxx/yyy error (ETIMEDOUT). Will retry in 1 minute. 1 retries left.
ERR_PNPM_META_FETCH_FAIL GET https://xxx/yyy: request to https://xxx/yyy failed, reason: connect ETIMEDOUT xxx.xxx.xxx.xxx:443.
This error happened while installing a direct dependency of xxx.
Symptom
The connection timed out, and metadata of the target package cannot be retrieved from the remote NPM repository specified in configuration.
Possible Causes
The issue arises from network failures or incorrect NPM repository URL configuration.
Solution
- Check whether the NPM repository URL is correct and whether there are firewall or proxy restrictions to ensure accessibility of the configured repository URL.
- Contact the repository provider to check whether the repository URL is available, or use a new NPM repository URL.
00308022 Failed to Install Packages in Offline Mode
Error Message
xxx install execute failed. More details:
ERR_PNPM_NO_OFFLINE_META Failed to resolve yyy@a.b.c in package mirror xxx.
This error happened while installing a direct dependency of xxx.
Symptom
PNPM cannot locate the metadata of a dependency package from the local cache in offline mode.
Possible Causes
Related dependencies are not fully packaged, causing lookup failures in offline environments.
Solution
- Check whether the offline package has been completely downloaded before the migration.
- For details, see Setting Up the Development Environment Offline.
00308023 NPM Repository Server Certificate Expired
Error Message
xxx install execute failed. More details:
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://xxx failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in: xxx
Symptom
The certificate of the NPM repository server has expired.
Possible Causes
The certificate of the remote NPM repository server has expired.
Solution
Contact the repository provider to ensure that the certificate of the repository server is valid, or use a new NPM repository URL.
00308024 Connection to the NPM Repository Times Out
Error Message
xxx install execute failed. More details:
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://xxx failed, reason: connect ETIMEDOUT xxx.xxx.xxx.xxx:443
This error happened while installing a direct dependency of xxx.
Symptom
The connection to the configured NPM repository times out.
Possible Causes
The issue arises from network failures or incorrect NPM repository URL configuration.
Solution
- Check whether the NPM repository URL is correct and whether there are firewall or proxy restrictions to ensure accessibility of the configured repository URL.
- Contact the repository provider to check whether the repository URL is available, or use a new NPM repository URL.
00308025 Failed to Reset the Daemon Registry
Error Message
Failed to reset daemon registry file: XXX.
Symptom
Failed to reset the daemon registry.
Possible Causes
DevEco Studio does not have the permission to operate the daemon registry file, or the registry file is occupied.
Solution
Manually delete the daemon registry file.